
/* ═══════════════════════════════════════════════════════════════════════════
   KIT PRODOTTI
   ═══════════════════════════════════════════════════════════════════════════ */

/* Page layout */
.kit-page { max-width: none; margin: 0 auto; padding: 12px 16px 80px; width: 100%; }

/* Workspace shell */
.kit-page-shell {
    max-width: none;
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
}

.kit-main-header,
.kit-detail-hero {
    position: relative;
    overflow: hidden;
    border: 1px solid #dbe5f0;
    border-radius: 28px;
    padding: 22px 24px;
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 32%),
        linear-gradient(135deg, #f8fafc 0%, #f1f5f9 52%, #ffffff 100%);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.06);
}

.kit-main-hero,
.kit-detail-toolbar {
    position: relative;
    z-index: 1;
}

.kit-main-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(148, 163, 184, 0.24);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #0f766e;
}

.kit-main-mobile-overview {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.kit-main-mobile-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #dbe5f0;
    background: rgba(255, 255, 255, 0.92);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    color: #475569;
}

.kit-main-mobile-badge strong {
    color: #0f172a;
}

.kit-main-heading-row {
    margin-top: 14px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.kit-main-heading-copy {
    max-width: 680px;
}

.kit-main-title {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.85rem;
    line-height: 1.05;
    color: #0f172a;
}

.kit-main-title i {
    color: #0f766e;
    font-size: 1.2rem;
}

.kit-main-subtitle {
    margin: 10px 0 0;
    max-width: 60ch;
    font-size: 0.96rem;
    line-height: 1.6;
    color: #475569;
}

.kit-main-stats {
    min-width: 520px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.kit-main-stat {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(203, 213, 225, 0.9);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.kit-main-stat-value {
    font-size: 1.45rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
}

.kit-main-stat-label {
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
}

.kit-main-actions {
    margin-top: 0;
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    min-width: 0;
}

.kit-main-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    padding: 11px 18px;
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    background: linear-gradient(135deg, #0f172a 0%, #1f2937 100%);
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.16);
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
}

.kit-main-cta:hover {
    transform: translateY(-1px);
    border-color: rgba(15, 23, 42, 0.18);
    background: linear-gradient(135deg, #111827 0%, #334155 100%);
    box-shadow: 0 16px 28px rgba(15, 23, 42, 0.18);
}

.kit-main-cta i {
    font-size: 0.8rem;
}

.kit-main-cta--action span {
    line-height: 1;
}

.kit-main-note {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: rgba(255, 255, 255, 0.9);
    font-size: 0.78rem;
    font-weight: 700;
    color: #64748b;
}

.kit-main-note i {
    color: #0f766e;
}

.kit-main-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 2px 2px;
    border: none;
    border-radius: 0;
    background: transparent;
}

.kit-main-tab {
    flex: 1 1 0;
    min-width: 190px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255,255,255,0.92) 0%, rgba(243,238,232,0.92) 100%);
    color: #475569;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.72), 0 10px 22px rgba(15, 23, 42, 0.05);
    transition: transform 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.kit-main-tab:hover {
    transform: translateY(-1px);
    border-color: rgba(15, 23, 42, 0.14);
    background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(239,234,227,0.98) 100%);
    color: #0f172a;
}

.kit-main-tab--active {
    background: #0f172a;
    color: #ffffff;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.2);
}

.kit-main-tab-copy {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.kit-main-tab-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.kit-main-tab-hint {
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.3;
    color: #64748b;
}

.kit-main-tab--active .kit-main-tab-hint {
    color: rgba(255, 255, 255, 0.76);
}

.kit-main-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: inherit;
    font-size: 0.75rem;
    font-weight: 800;
}

.kit-main-tab--active .kit-main-tab-count {
    background: rgba(255, 255, 255, 0.14);
}

.kit-main-surface {
    padding: 20px;
    border-radius: 24px;
    border: 1px solid #dbe5f0;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.05);
}

.kit-main-content {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.kit-main-section {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 4px 4px 14px;
    border-bottom: 1px solid #eef2f7;
}

.kit-main-section-copy {
    max-width: 660px;
}

.kit-main-section-title {
    margin: 8px 0 0;
    font-size: 1.2rem;
    font-weight: 800;
    color: #0f172a;
}

.kit-main-section-text {
    margin: 8px 0 0;
    font-size: 0.88rem;
    line-height: 1.6;
    color: #64748b;
}

.kit-main-summary-strip {
    min-width: 340px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.kit-main-summary-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.kit-main-summary-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: #0f172a;
}

.kit-main-summary-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
}

.kit-main-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kit-page-shell .ordine-group {
    border-color: #dbe5f0;
    background: #fbfdff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.kit-page-shell .ordine-group[open] {
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
}

.kit-page-shell .kit-group-summary,
.kit-page-shell .kit-record-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    width: 100%;
    padding: 16px 18px;
    column-gap: 14px;
    row-gap: 12px;
    background: linear-gradient(180deg, #f8fafc 0%, #f2f6fb 100%);
}

.kit-page-shell .ordine-group[open] .kit-group-summary,
.kit-page-shell .ordine-group[open] .kit-record-summary {
    background: linear-gradient(180deg, #f3f7fb 0%, #edf3fa 100%);
}

.kit-summary-left {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    align-self: stretch;
}

.kit-summary-heading {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: nowrap;
    min-width: 0;
}

.kit-summary-heading-copy {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kit-summary-heading-copy .og-operatore {
    line-height: 1.3;
    color: #0f172a;
    overflow-wrap: anywhere;
}

.kit-summary-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    border: 1px solid #dbe5f0;
    background: linear-gradient(180deg, #ffffff 0%, #e2e8f0 100%);
    color: #0f172a;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
    flex-shrink: 0;
}

.kit-summary-heading .og-operatore {
    min-width: 0;
}

.kit-summary-mobile-grid,
.kit-summary-mobile-hint {
    display: none;
}

.kit-summary-mobile-grid {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.kit-summary-mobile-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: rgba(255, 255, 255, 0.9);
}

.kit-summary-mobile-stat strong {
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
}

.kit-summary-mobile-stat span {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
}

.kit-summary-mobile-hint {
    width: 100%;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.35;
    color: #64748b;
}

.kit-summary-mobile-hint::before {
    content: '\f061';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.72rem;
    color: #0f766e;
}

.kit-summary-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: #dcfce7;
    border: 1px solid #bbf7d0;
    color: #166534;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.kit-summary-status--muted {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #64748b;
}

.kit-summary-pills {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 0;
}

.kit-summary-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #dbe5f0;
    color: #475569;
    font-size: 0.76rem;
    font-weight: 700;
}

.kit-summary-pill--strong {
    background: #e0f2fe;
    border-color: #bae6fd;
    color: #0f172a;
}

.kit-mobile-summary-actions,
.kit-mobile-summary-stats {
    display: none;
}

.kit-mobile-summary-stats {
    gap: 8px;
}

.kit-mobile-summary-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.kit-mobile-summary-stat strong {
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
}

.kit-mobile-summary-stat span {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
}

.kit-mobile-summary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid #dbe5f0;
    background: #ffffff;
    color: #334155;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, background 0.15s, border-color 0.15s, color 0.15s;
}

.kit-mobile-summary-action:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

.kit-mobile-summary-action--primary {
    background: #0f172a;
    border-color: #0f172a;
    color: #ffffff;
}

.kit-mobile-summary-action--primary:hover {
    background: #1e293b;
    border-color: #1e293b;
    color: #ffffff;
}

.kit-mobile-summary-action--danger {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #be123c;
}

.kit-mobile-summary-action--danger:hover {
    background: #ffe4e6;
    border-color: #fda4af;
    color: #9f1239;
}

.kit-accordion-body {
    padding: 0 14px 14px;
    background: linear-gradient(180deg, rgba(241, 245, 249, 0.72) 0%, rgba(255, 255, 255, 0.96) 100%);
}

.kit-section-card {
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #ffffff;
    overflow: hidden;
}

.kit-section-card + .kit-section-card {
    margin-top: 10px;
}

.kit-section-card-summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    list-style: none;
    background: #fcfdff;
}

.kit-section-card-summary::-webkit-details-marker {
    display: none;
}

.kit-section-card[open] .kit-section-card-summary {
    background: #f8fafc;
    border-bottom: 1px solid #eef2f7;
}

.kit-section-card-title {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.kit-section-card-name {
    font-size: 0.92rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.kit-section-card-meta {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
}

.kit-section-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.kit-section-chevron {
    font-size: 0.78rem;
    color: #94a3b8;
    transition: transform 0.2s;
}

.kit-section-card[open] .kit-section-chevron {
    transform: rotate(180deg);
}

.kit-section-card-body {
    padding: 14px 16px 16px;
    overflow: hidden;
}

.kit-section-editor-row {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid #eef2f7;
    background: #f8fafc;
}

.kit-section-editor-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kit-component-field-label--visible {
    display: block;
}

.kit-section-name-input {
    max-width: none;
    padding: 10px 12px;
    border-color: #dbe5f0;
    background: #ffffff;
    box-shadow: none;
    font-weight: 700;
    color: #0f172a;
}

.kit-section-name-input:focus {
    border-color: #cbd5e1;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.16);
}

.kit-component-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px 110px 96px;
    gap: 10px;
    align-items: center;
}

.kit-component-head {
    padding: 0 0 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid #eef2f7;
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.kit-component-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

.kit-component-row {
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

.kit-component-row:last-child {
    border-bottom: none;
}

.kit-component-controls {
    display: grid;
    grid-template-columns: minmax(0, 112px) minmax(0, 104px) minmax(0, 108px);
    gap: 10px;
    align-items: end;
}

.kit-component-controls > * {
    min-width: 0;
}

.kit-component-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.kit-component-field-label {
    display: none;
    font-size: 0.64rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
}

.kit-component-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kit-component-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.kit-component-code {
    font-size: 0.78rem;
    color: #94a3b8;
}

.kit-component-input,
.kit-component-unit {
    width: 100%;
    min-height: 36px;
    box-sizing: border-box;
}

.kit-component-input {
    text-align: right;
}

.kit-component-unit {
    padding-right: 30px;
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #64748b 50%),
        linear-gradient(135deg, #64748b 50%, transparent 50%);
    background-position: calc(100% - 15px) calc(50% - 3px), calc(100% - 10px) calc(50% - 3px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.kit-component-delete {
    justify-self: end;
    min-height: 36px;
    width: 100%;
    gap: 6px;
}

.kit-component-delete span {
    display: none;
}

.kit-component-empty {
    margin: 0;
    padding: 12px 0;
    color: #64748b;
    font-size: 0.84rem;
}

.kit-section-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eef2f7;
    display: flex;
    justify-content: flex-end;
}

.kit-section-add-btn {
    white-space: nowrap;
}

.kit-empty-state--panel {
    min-height: 280px;
    border: 1px dashed #cbd5e1;
    border-radius: 22px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.kit-page-shell .kit-empty-state--panel .btn-modal-send {
    margin-top: 4px;
}

.kit-record-item {
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.kit-record-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kit-record-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.kit-record-title {
    font-size: 0.96rem;
    font-weight: 700;
    color: #0f172a;
}

.kit-record-code {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 0.74rem;
    font-weight: 700;
}

.kit-record-meta {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
}

.kit-record-subtitle {
    font-size: 0.82rem;
    line-height: 1.55;
    color: #64748b;
}

.kit-record-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.kit-record-btn {
    white-space: nowrap;
}

.kit-detail-hero {
    padding: 18px 20px;
}

.kit-detail-toolbar {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.kit-detail-titles {
    flex: 1;
    min-width: 0;
}

.kit-detail-heading-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.kit-detail-heading-row .kit-view-nome {
    font-size: 1.55rem;
    font-weight: 800;
    color: #0f172a;
}

.kit-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.kit-page-shell--detail .kit-order-summary {
    margin-bottom: 0;
}

.kit-order-summary--hero {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.kit-page-shell--detail .kit-order-layout--detail {
    grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.9fr);
    align-items: start;
}

.kit-page-shell--detail .kit-order-section--wide {
    grid-column: 1 / -1;
}

.kit-order-distinta-meta {
    margin-top: -4px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
}

.kit-page-shell--detail .kit-ns-units-card,
.kit-page-shell--detail .kit-ns-comps-panel,
.kit-page-shell--detail .kit-ns-distinta-preview {
    margin-bottom: 0;
}

/* Header */
.kit-page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
}
.kit-page-title { font-size: 1.15rem; font-weight: 700; color: #1e293b; display: flex; align-items: center; gap: 8px; }
.kit-nuevo-btn, .kit-nuovo-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: 10px; font-size: 0.8rem; font-weight: 600;
    background: #1e293b; color: #fff; border: none; cursor: pointer; transition: background .2s;
}
.kit-nuovo-btn:hover { background: #334155; }

/* Cards grid */
.kit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 14px; }
.kit-card {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
    padding: 16px; cursor: pointer; transition: box-shadow .2s, border-color .2s;
}
.kit-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); border-color: #cbd5e1; }
.kit-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.kit-card-nome { font-size: 0.95rem; font-weight: 700; color: #1e293b; }
.kit-card-gear {
    background: none; border: none; cursor: pointer; color: #94a3b8; font-size: 1rem;
    padding: 4px 6px; border-radius: 6px; transition: color .15s, background .15s;
}
.kit-card-gear:hover { color: #475569; background: #f1f5f9; }
.kit-card-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.kit-meta-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px; border-radius: 20px; font-size: 0.72rem; font-weight: 600;
    background: #f1f5f9; color: #475569;
}
.kit-meta-pill--pronti { background: #dcfce7; color: #15803d; }

/* Empty state */
.kit-empty-state {
    text-align: center; padding: 60px 20px; color: #94a3b8;
    display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.kit-empty-icon { font-size: 2.5rem; color: #cbd5e1; }

/* View header */
.kit-view-header {
    display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.kit-back-btn {
    background: none; border: 1px solid #e2e8f0; color: #475569; font-size: 0.9rem;
    padding: 6px 10px; border-radius: 8px; cursor: pointer; transition: background .15s;
    flex-shrink: 0;
}
.kit-back-btn:hover { background: #f1f5f9; }
.kit-view-nome { font-size: 1rem; font-weight: 700; color: #1e293b; flex: 1; }
.kit-gear-btn-inline {
    background: none; border: 1px solid #e2e8f0; color: #64748b; font-size: 0.9rem;
    padding: 6px 10px; border-radius: 8px; cursor: pointer; transition: background .15s;
}
.kit-gear-btn-inline:hover { background: #f1f5f9; }

/* Layout operativo ordine / distinta */
.kit-order-summary,
.kit-order-section,
.kit-order-meta-card,
.kit-ns-units-card,
.kit-ns-comps-panel,
.kit-ns-distinta-preview,
.kit-compose-builder {
    background: #ffffff;
    border: 1px solid #dbe5f0;
    border-radius: 16px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
}

.kit-order-summary {
    padding: 18px 18px 16px;
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.kit-order-summary-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.kit-order-summary-label,
.kit-order-section-title,
.kit-ns-panel-title,
.kit-order-meta-title,
.kit-compose-group-title,
.kit-ns-section-title,
.kit-distinta-section-title,
.kit-compose-selected-label,
.kit-ns-units-label {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
}

.kit-order-summary-total {
    margin-top: 6px;
    font-size: 1.85rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.05;
}

.kit-order-summary-note {
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.5;
}

.kit-order-summary-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.kit-order-summary-actions .kit-btn-secondary,
.kit-order-summary-actions .kit-cfg-add-btn,
.kit-order-summary-actions .kit-spedisci-btn {
    align-self: stretch;
}

.kit-order-summary-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.kit-order-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.kit-order-meta-card {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.kit-order-autocomplete-wrapper {
    width: 100%;
}

.kit-order-meta-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d6dfeb;
    border-radius: 10px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 0.84rem;
    transition: border-color .15s, background .15s, box-shadow .15s;
    box-sizing: border-box;
}

.kit-order-meta-input:focus,
.kit-order-stepper-input:focus {
    outline: none;
    border-color: #94a3b8;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.16);
}

.kit-order-ref-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 22px;
}

.kit-order-ref-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    font-size: 0.76rem;
    font-weight: 700;
}

.kit-order-ref-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: #1d4ed8;
    cursor: pointer;
    padding: 0;
    transition: background .15s, color .15s;
}

.kit-order-ref-chip-remove:hover {
    background: #dbeafe;
    color: #1e40af;
}

.kit-order-meta-empty,
.kit-order-meta-help,
.kit-order-line-meta,
.kit-distinta-row-meta,
.kit-distinta-row-note,
.kit-ns-comp-code,
.kit-ns-comp-qty-base {
    font-size: 0.76rem;
    color: #94a3b8;
    line-height: 1.45;
}

.kit-order-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #eef2f7;
    font-size: 0.84rem;
    color: #475569;
}

.kit-order-meta-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.kit-order-meta-row strong {
    color: #0f172a;
    font-size: 0.86rem;
    font-weight: 700;
    text-align: right;
}

.kit-order-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.9fr);
    gap: 16px;
}

.kit-order-section {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.kit-order-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #475569;
}

.kit-compose-builder {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.kit-compose-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kit-compose-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.kit-compose-option {
    padding: 9px 14px;
    border-radius: 999px;
    border: 1px solid #d6dfeb;
    background: #ffffff;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s, transform .15s;
}

.kit-compose-option:hover {
    border-color: #94a3b8;
    background: #f8fafc;
    color: #0f172a;
}

.kit-compose-option--active {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.kit-compose-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-top: 6px;
    border-top: 1px solid #eef2f7;
}

.kit-compose-selected {
    min-width: 0;
}

.kit-compose-selected-name,
.kit-order-line-name,
.kit-distinta-row-name,
.kit-ns-comp-name {
    margin-top: 4px;
    font-size: 0.96rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}

.kit-order-lines,
.kit-ns-comps {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kit-order-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.kit-order-line-main,
.kit-distinta-row-main,
.kit-ns-comp-info {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.kit-order-stepper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.kit-order-stepper-btn {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid #d6dfeb;
    background: #ffffff;
    color: #334155;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, border-color .15s;
}

.kit-order-stepper-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.kit-order-stepper-input {
    width: 62px;
    min-width: 62px;
    padding: 7px 8px;
    border: 1px solid #d6dfeb;
    border-radius: 10px;
    background: #ffffff;
    color: #0f172a;
    font-size: 0.92rem;
    font-weight: 700;
    text-align: center;
    box-sizing: border-box;
}

.kit-distinta-section,
.kit-ns-section {
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
}

.kit-distinta-section + .kit-distinta-section,
.kit-ns-section + .kit-ns-section {
    margin-top: 12px;
}

.kit-distinta-section-title,
.kit-ns-section-title {
    color: #4f46e5;
}

.kit-distinta-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid #eef2f7;
}

.kit-distinta-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.kit-distinta-row-qty,
.kit-ns-comp-total {
    font-size: 0.85rem;
    font-weight: 800;
    color: #334155;
    white-space: nowrap;
    align-self: center;
}

.kit-distinta-alert {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #dbeafe;
    background: #eff6ff;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.kit-distinta-alert--warning {
    background: #fff7ed;
    border-color: #fed7aa;
}

.kit-distinta-alert-title {
    font-size: 0.84rem;
    font-weight: 800;
    color: #0f172a;
}

.kit-distinta-alert-body,
.kit-distinta-alert-meta {
    font-size: 0.78rem;
    line-height: 1.45;
    color: #64748b;
}

.kit-ns-units-card {
    padding: 14px 16px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.kit-ns-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eef2f7;
}

.kit-ns-sel-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    font-weight: 700;
    color: #4f46e5;
    cursor: pointer;
    white-space: nowrap;
}

.kit-ns-check {
    width: 15px;
    height: 15px;
    accent-color: #4f46e5;
    flex-shrink: 0;
}

.kit-ns-comp-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color .15s, background .15s, transform .15s;
}

.kit-ns-comp-row:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.kit-ns-comp-row--checked {
    background: #eef6ff;
    border-color: #bfdbfe;
}

.kit-ns-comps-panel,
.kit-ns-distinta-preview {
    padding: 16px;
}

.kit-ns-panel-title {
    margin-bottom: 12px;
}

@media (max-width: 900px) {
    .kit-order-meta-grid,
    .kit-order-layout {
        grid-template-columns: 1fr;
    }

    .kit-order-summary-top,
    .kit-compose-footer,
    .kit-ns-units-card {
        flex-direction: column;
        align-items: stretch;
    }

    .kit-order-summary-actions {
        justify-content: flex-start;
    }

    .kit-order-line,
    .kit-distinta-row,
    .kit-ns-comp-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .kit-order-stepper {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .kit-order-stepper-input {
        flex: 0 0 72px;
    }
}

/* Tabs */
.kit-tabs {
    display: flex; gap: 4px; margin-bottom: 14px;
    border-bottom: 2px solid #e2e8f0; padding-bottom: 0;
}
.kit-tab {
    padding: 8px 14px; font-size: 0.78rem; font-weight: 600;
    border: none; background: none; color: #64748b; cursor: pointer;
    border-bottom: 2px solid transparent; margin-bottom: -2px;
    border-radius: 6px 6px 0 0; transition: color .15s;
    display: inline-flex; align-items: center; gap: 5px; position: relative;
}
.kit-tab:hover { color: #1e293b; background: #f8fafc; }
.kit-tab--active { color: #1e293b; border-bottom-color: #1e293b; }
.kit-tab-badge {
    width: 7px; height: 7px; border-radius: 50%; background: #22c55e;
    position: absolute; top: 6px; right: 6px;
}
.kit-tab-panel { display: none; }
.kit-tab-panel--active { display: block; }

/* BOM table */
.kit-table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid #e2e8f0; margin-bottom: 10px; }
.kit-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.kit-table thead th {
    background: #f8fafc; color: #64748b; font-size: 0.7rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .05em; padding: 10px 10px;
    border-bottom: 1px solid #e2e8f0; text-align: left; white-space: nowrap;
}
.kit-table tbody tr { border-bottom: 1px solid #f1f5f9; transition: background .1s; }
.kit-table tbody tr:hover { background: #f8fafc; }
.kit-table td { padding: 8px 10px; color: #1e293b; vertical-align: middle; }
.kit-bom-sez-row .kit-bom-sez-cell {
    background: #f1f5f9; color: #475569; font-size: 0.7rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .08em; padding: 6px 10px;
}
.kit-mat { font-weight: 500; }
.kit-coeff { text-align: center; }
.kit-coeff-on { font-weight: 700; color: #1e293b; }
.kit-coeff-off { color: #94a3b8; }
.kit-fab { text-align: right; font-weight: 600; }
.kit-fab-zero { color: #94a3b8; }
.kit-car-cell { white-space: nowrap; }
.kit-car-input {
    width: 60px; padding: 5px 7px; border: 1px solid #e2e8f0; border-radius: 7px;
    font-size: 0.82rem; font-weight: 600; text-align: right; color: #1e293b;
    background: #fff; transition: border-color .15s;
}
.kit-car-input:focus { outline: none; border-color: #94a3b8; }
.kit-car-liberi { font-size: 0.7rem; color: #94a3b8; margin-left: 5px; }
.kit-ord-zero { color: #94a3b8; text-align: right; }
.kit-ord-manca { color: #ef4444; font-weight: 700; text-align: right; }
.kit-ord-ok { color: #16a34a; font-weight: 700; text-align: right; }
.kit-legend {
    display: flex; flex-wrap: wrap; gap: 10px; font-size: 0.72rem;
    color: #64748b; margin-bottom: 16px; padding: 0 2px;
}
.kit-leg-item { display: inline-flex; align-items: center; gap: 4px; }

/* Quantità tab */
.kit-qty-card {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 18px;
    margin-bottom: 16px;
}
.kit-qty-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .08em; color: #64748b; margin-bottom: 14px; }
.kit-qty-inputs { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.kit-qty-item { display: flex; flex-direction: column; gap: 6px; }
.kit-qty-item label { font-size: 0.78rem; font-weight: 600; color: #475569; white-space: nowrap; }
.kit-qty-input {
    width: 72px; padding: 8px 10px; border: 1.5px solid #e2e8f0; border-radius: 9px;
    font-size: 0.9rem; font-weight: 700; text-align: center; color: #1e293b;
    background: #f8fafc; transition: border-color .15s;
}
.kit-qty-input:focus { outline: none; border-color: #64748b; background: #fff; }
.kit-qty-total-box { display: flex; flex-direction: column; gap: 6px; }
.kit-qty-total-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #64748b; }
.kit-qty-total-val { font-size: 1.5rem; font-weight: 800; color: #1e293b; }

/* Spedizione / Pronti tab */
.kit-sped-section { padding: 4px 0; }
.kit-sped-title { font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .08em; color: #475569; margin-bottom: 12px;
    display: flex; align-items: center; gap: 7px;
}
.kit-sped-sa-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.kit-sped-sa-row {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
    padding: 12px 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.kit-sped-sa-label { font-size: 0.85rem; font-weight: 600; color: #1e293b; flex: 1; display: flex; align-items: center; gap: 8px; }
.kit-sped-var-pill {
    font-size: 0.68rem; font-weight: 700; padding: 2px 7px; border-radius: 20px;
    background: #e0f2fe; color: #0369a1;
}
.kit-sped-sa-stats { display: flex; gap: 8px; align-items: center; }
.kit-sped-pronti-cnt { font-size: 0.78rem; font-weight: 700; color: #1e293b; }
.kit-sped-max { font-size: 0.72rem; font-weight: 600; padding: 2px 8px; border-radius: 20px; }
.kit-sped-max--ok { background: #dcfce7; color: #15803d; }
.kit-sped-max--zero { background: #f1f5f9; color: #94a3b8; }
.kit-pronti-ctrl { display: flex; align-items: center; gap: 4px; }
.kit-pronti-btn {
    width: 28px; height: 28px; border-radius: 7px; border: 1px solid #e2e8f0;
    background: #f8fafc; color: #1e293b; font-size: 1rem; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.kit-pronti-btn:hover { background: #e2e8f0; }
.kit-pronti-input {
    width: 52px; text-align: center; padding: 4px 6px;
    border: 1.5px solid #e2e8f0; border-radius: 7px; font-size: 0.85rem;
    font-weight: 700; color: #1e293b;
}
.kit-pronti-val-on { border-color: #22c55e; }
.kit-sped-footer { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.kit-sped-nota-input {
    flex: 1; min-width: 160px; padding: 9px 12px;
    border: 1px solid #e2e8f0; border-radius: 9px; font-size: 0.82rem; color: #1e293b;
}
.kit-spedisci-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px;
    background: #1e293b; color: #fff; border: none; border-radius: 9px;
    font-size: 0.82rem; font-weight: 700; cursor: pointer; transition: background .2s;
    white-space: nowrap;
}
.kit-spedisci-btn:hover { background: #334155; }

/* Movimenti tab */
.kit-mov-form {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px;
    padding: 14px; margin-bottom: 14px;
}
.kit-mov-form-field { display: flex; flex-direction: column; gap: 5px; }
.kit-mov-form-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #64748b; }
.kit-mov-form select, .kit-mov-form input[type="number"], .kit-mov-form input[type="text"] {
    padding: 7px 10px; border: 1px solid #e2e8f0; border-radius: 8px;
    font-size: 0.82rem; color: #1e293b; background: #fff;
}
.kit-mov-btn-carico {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 14px; background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0;
    border-radius: 9px; font-size: 0.8rem; font-weight: 700; cursor: pointer; transition: background .15s;
}
.kit-mov-btn-carico:hover { background: #bbf7d0; }
.kit-mov-btn-scarico {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 14px; background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5;
    border-radius: 9px; font-size: 0.8rem; font-weight: 700; cursor: pointer; transition: background .15s;
}
.kit-mov-btn-scarico:hover { background: #fca5a5; }
.kit-mov-list { display: flex; flex-direction: column; gap: 6px; }
.kit-mov-empty { text-align: center; color: #94a3b8; font-size: 0.82rem; padding: 20px 0; }
.kit-mov-item {
    display: flex; align-items: center; gap: 8px; padding: 8px 12px;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 9px; font-size: 0.8rem;
}
.kit-mov-badge {
    display: inline-flex; padding: 2px 7px; border-radius: 5px;
    font-size: 0.68rem; font-weight: 700; text-transform: uppercase; flex-shrink: 0;
}
.kit-mov-badge.carico { background: #dcfce7; color: #15803d; }
.kit-mov-badge.scarico { background: #fee2e2; color: #b91c1c; }
.kit-mov-badge.spedizione { background: #dbeafe; color: #1d4ed8; }
.kit-mov-badge.reso { background: #fef3c7; color: #92400e; }
.kit-mov-mat { flex: 1; font-weight: 500; color: #1e293b; }
.kit-mov-qty { font-weight: 700; }
.kit-mov-qty.carico { color: #15803d; }
.kit-mov-qty.scarico { color: #b91c1c; }
.kit-mov-nota { font-size: 0.72rem; color: #94a3b8; flex: 1; }
.kit-mov-ts { font-size: 0.68rem; color: #94a3b8; white-space: nowrap; }
.kit-mov-del, .kit-mov-edit {
    background: none; border: none; cursor: pointer; color: #94a3b8;
    font-size: 0.9rem; padding: 3px; transition: color .15s;
}
.kit-mov-del:hover { color: #ef4444; }
.kit-mov-edit:hover { color: #1d4ed8; }
.kit-mov-assemb-group {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
    overflow: hidden;
}
.kit-mov-assemb-summary {
    display: flex; align-items: center; gap: 8px; padding: 9px 12px;
    cursor: pointer; font-size: 0.8rem; list-style: none;
}
.kit-mov-assemb-summary::-webkit-details-marker { display: none; }
.kit-mov-assemb-label { flex: 1; font-weight: 600; color: #1e293b; }
.kit-assemb-chev { color: #94a3b8; font-size: 0.7rem; transition: transform .2s; }
details[open] .kit-assemb-chev { transform: rotate(180deg); }
.kit-assemb-sub-list { border-top: 1px solid #f1f5f9; padding: 8px 12px; display: flex; flex-direction: column; gap: 4px; }
.kit-assemb-sub-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 0.78rem; }
.kit-assemb-sub-mat { color: #475569; }
.kit-sped-bom-divider { font-size: 0.68rem; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; margin: 6px 0 2px; font-weight: 700; }
.kit-sped-item-row { background: #f8fafc; padding: 4px 6px; border-radius: 6px; }
.kit-mov-reso-group summary { background: #fffbeb; }

/* Actions bar */
.kit-actions-bar {
    display: flex; gap: 10px; align-items: center; justify-content: flex-end;
    padding: 14px 0 0; border-top: 1px solid #e2e8f0; margin-top: 20px;
}
.kit-reso-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px;
    background: #fff; color: #475569; border: 1px solid #e2e8f0;
    border-radius: 9px; font-size: 0.8rem; font-weight: 600; cursor: pointer;
    transition: background .15s;
}
.kit-reso-btn:hover { background: #f1f5f9; }
.kit-save-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px;
    background: #fff; color: #1e293b; border: 1px solid #cbd5e1;
    border-radius: 9px; font-size: 0.8rem; font-weight: 600; cursor: pointer;
    transition: all .15s;
}
.kit-save-btn:hover { background: #f1f5f9; }
.kit-save-loading { opacity: .6; cursor: not-allowed; }
.kit-save-ok { border-color: #22c55e; color: #15803d; background: #dcfce7; }
.kit-save-err { border-color: #ef4444; color: #b91c1c; background: #fee2e2; }
.kit-btn-secondary {
    padding: 8px 16px; background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0;
    border-radius: 9px; font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: background .15s;
}
.kit-btn-secondary:hover { background: #e2e8f0; }
.kit-btn-danger {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px;
    background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5;
    border-radius: 9px; font-size: 0.8rem; font-weight: 600; cursor: pointer;
}
.kit-btn-danger:hover { background: #fca5a5; }

/* ═══ CONFIGURATORE ═══════════════════════════════════════════════════════════ */
.kit-cfg-panel { padding: 4px 0; }
.kit-cfg-section { display: flex; flex-direction: column; gap: 10px; }
.kit-cfg-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #64748b; }
.kit-cfg-input {
    padding: 9px 12px; border: 1px solid #e2e8f0; border-radius: 9px;
    font-size: 0.85rem; color: #1e293b; background: #fff; width: 100%; box-sizing: border-box;
}
.kit-cfg-input:focus { outline: none; border-color: #94a3b8; }
.kit-cfg-input-small { width: 80px; }
.kit-cfg-input-sez { font-weight: 700; }
.kit-cfg-input-comp { flex: 1; }
.kit-cfg-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kit-cfg-select {
    padding: 9px 12px; border: 1px solid #e2e8f0; border-radius: 9px;
    font-size: 0.82rem; color: #1e293b; background: #fff; flex: 1;
}
.kit-cfg-del-btn {
    background: none; border: none; color: #94a3b8; cursor: pointer;
    font-size: 0.85rem; padding: 5px 7px; border-radius: 7px; transition: color .15s, background .15s;
    flex-shrink: 0;
}
.kit-cfg-del-btn:hover { color: #ef4444; background: #fee2e2; }
.kit-cfg-copy-btn {
    background: #eff6ff; border: 1px solid #bfdbfe; color: #2563eb; cursor: pointer;
    font-size: 0.82rem; padding: 6px 9px; border-radius: 8px; transition: background .15s, border-color .15s, color .15s;
    flex-shrink: 0;
}
.kit-cfg-copy-btn:hover { background: #dbeafe; border-color: #93c5fd; color: #1d4ed8; }
.kit-cfg-add-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px;
    background: #f8fafc; color: #475569; border: 1px dashed #cbd5e1;
    border-radius: 9px; font-size: 0.78rem; font-weight: 600; cursor: pointer;
    transition: background .15s; align-self: flex-start;
}
.kit-cfg-add-btn:hover { background: #e2e8f0; border-color: #94a3b8; }
.kit-cfg-add-comp-btn {
    display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px;
    background: #fff; color: #475569; border: 1px dashed #cbd5e1;
    border-radius: 7px; font-size: 0.73rem; font-weight: 600; cursor: pointer;
    margin-top: 4px; transition: background .15s;
}
.kit-cfg-add-comp-btn:hover { background: #f1f5f9; }
.kit-cfg-sez-block {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 14px;
    display: flex; flex-direction: column; gap: 8px;
}
.kit-cfg-sez-header { display: flex; align-items: center; gap: 8px; }
.kit-cfg-del-sez { font-size: 1rem; }
.kit-cfg-comp-header {
    display: flex; align-items: center; font-size: 0.67rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em; color: #94a3b8;
    padding: 0 4px; gap: 8px;
}
.kit-cfg-comp-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kit-cfg-coeffs { display: flex; gap: 5px; flex-wrap: wrap; }
.kit-cfg-coeff {
    width: 52px; padding: 6px 8px; border: 1px solid #e2e8f0; border-radius: 7px;
    font-size: 0.78rem; text-align: center; color: #1e293b; background: #f8fafc;
}
.kit-cfg-coeff-lbl { width: 52px; text-align: center; flex-shrink: 0; }
.kit-cfg-help { font-size: 0.78rem; color: #64748b; background: #f8fafc; padding: 9px 12px; border-radius: 8px; line-height: 1.5; }
.kit-cfg-warn { font-size: 0.78rem; color: #92400e; background: #fef3c7; padding: 9px 12px; border-radius: 8px; }

/* Variante field (label + input stacked) */
.kit-cfg-var-field { display: flex; flex-direction: column; gap: 4px; }

/* SA grouped */
.kit-cfg-sa-group {
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px;
    padding: 12px 14px; display: flex; flex-direction: column; gap: 8px;
}
.kit-cfg-sa-group-header {
    display: flex; align-items: center; gap: 8px; margin-bottom: 2px;
}
.kit-cfg-sa-count { font-size: 0.7rem; color: #94a3b8; font-weight: 600; }
.kit-cfg-sa-empty { font-size: 0.78rem; color: #94a3b8; padding: 4px 0; }
.kit-cfg-sarow { background: #fff; border-radius: 8px; padding: 4px 6px; }

/* Info recap */
.kit-cfg-recap {
    background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 12px;
    padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
.kit-cfg-recap-row {
    display: flex; align-items: flex-start; gap: 10px;
    font-size: 0.82rem; color: #1e293b; line-height: 1.4;
}
.kit-cfg-recap-row i { color: #0284c7; margin-top: 2px; flex-shrink: 0; width: 14px; text-align: center; }
.kit-cfg-danger { padding-top: 10px; border-top: 1px solid #fee2e2; margin-top: 10px; }

/* Modal configurazione kit compatta */
.kcfg-section-lbl {
    font-size: 0.66rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    margin-bottom: 8px;
}

.kcfg-empty {
    padding: 18px 16px;
    border: 1px dashed #dbe5f0;
    border-radius: 14px;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.5;
    text-align: center;
}

.kcfg-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
}

.kcfg-comp-row {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) 74px 60px 28px;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid transparent;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}

.kcfg-comp-row:hover {
    border-color: #dbe5f0;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
}

.kcfg-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    display: inline-block;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.95);
}

.kcfg-name {
    min-width: 0;
    font-size: 0.83rem;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kcfg-code {
    font-size: 0.72rem;
    font-weight: 500;
    color: #94a3b8;
}

.kcfg-qty,
.kcfg-unit {
    width: 100%;
    min-width: 0;
    margin: 0;
    height: 30px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid #d9e2ec;
    background: #ffffff;
    font-size: 0.76rem;
    font-weight: 700;
    color: #475569;
    box-sizing: border-box;
}

.kcfg-qty {
    text-align: center;
}

.kcfg-qty:focus,
.kcfg-unit:focus {
    outline: none;
    border-color: #94a3b8;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.14);
}

.kcfg-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid #dbe5f0;
    background: #ffffff;
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}

.kcfg-pill:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #334155;
}

@media (max-width: 760px) {
    .kcfg-comp-row {
        grid-template-columns: 10px minmax(0, 1fr) 62px 54px 28px;
        gap: 6px;
        padding: 8px;
    }

    .kcfg-name {
        font-size: 0.78rem;
    }

    .kcfg-qty,
    .kcfg-unit {
        height: 28px;
        padding: 4px 8px;
        font-size: 0.72rem;
    }
}

/* Modal spedizione kit items list */
.kit-sped-item-row {
    display: flex; align-items: center; gap: 10px; padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}
.kit-sped-item-row:last-child { border-bottom: none; }
.kit-sped-item-info { display: flex; align-items: center; gap: 8px; flex: 1; }
.kit-sped-item-label { font-size: 0.85rem; font-weight: 600; color: #1e293b; }
.kit-sped-item-qty { font-size: 0.82rem; font-weight: 700; color: #64748b; }

/* Reso modal */
.kit-reso-item-row {
    display: flex; align-items: center; gap: 10px; padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}
.kit-reso-item-row:last-child { border-bottom: none; }
.kit-reso-item-label { flex: 1; font-size: 0.85rem; font-weight: 500; color: #1e293b; display: flex; align-items: center; gap: 6px; }
.kit-reso-qty-ctrl { display: flex; align-items: center; gap: 4px; }
.kit-reso-qty-btn {
    width: 28px; height: 28px; border-radius: 7px; border: 1px solid #e2e8f0;
    background: #f8fafc; color: #1e293b; font-size: 1rem; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.kit-reso-qty-btn:hover { background: #e2e8f0; }
.kit-reso-qty-inp {
    width: 48px; text-align: center; padding: 4px 6px;
    border: 1px solid #e2e8f0; border-radius: 7px; font-size: 0.82rem; font-weight: 700;
}
.kit-reso-bom-empty { font-size: 0.78rem; color: #94a3b8; text-align: center; padding: 10px 0; }

/* Modal import / copia sezioni kit */
.kit-import-modal-box {
    width: min(940px, calc(100vw - 28px));
    max-height: min(88vh, 820px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.kit-import-mode-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 20px 12px;
}
.kit-import-mode-btn {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #475569;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.kit-import-mode-btn--active {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #ffffff;
}
.kit-import-search-wrap { padding: 0 20px 12px; }
.kit-import-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    padding: 0 20px;
}
.kit-import-col,
.kit-import-target-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.kit-import-col-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #64748b;
}
.kit-import-list {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    min-height: 120px;
    max-height: 240px;
    overflow: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.kit-import-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #ffffff;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
}
.kit-import-option--active {
    border-color: #93c5fd;
    background: #eff6ff;
}
.kit-import-option input {
    margin-top: 2px;
    flex-shrink: 0;
}
.kit-import-option-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.kit-import-option-title {
    font-size: 0.84rem;
    font-weight: 700;
    color: #1e293b;
}
.kit-import-option-meta {
    font-size: 0.74rem;
    color: #64748b;
    line-height: 1.4;
}
.kit-import-source-card {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.kit-import-target-wrap {
    padding: 12px 20px 0;
}
.kit-import-target-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.kit-import-target-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.kit-import-preview {
    margin: 12px 20px 0;
}
.kit-import-empty {
    font-size: 0.78rem;
    color: #94a3b8;
    text-align: center;
    padding: 16px 10px;
}

/* Responsive */
@media (max-width: 600px) {
    .kit-grid { grid-template-columns: 1fr; }
    .kit-mov-form { grid-template-columns: 1fr; }
    .kit-tabs { flex-wrap: wrap; }
    .kit-tab { font-size: 0.72rem; padding: 6px 10px; }
    .kit-sped-sa-row { flex-direction: column; align-items: flex-start; }
    .kit-cfg-comp-row { flex-direction: column; align-items: flex-start; }
    .kit-import-columns { grid-template-columns: 1fr; }
    .kit-import-target-head { align-items: flex-start; }
}


/* ─── Ported from PROD ────────────────────────────────────────────────── */
/* ─── Date ordine/consegna in card ─────────────────────────────── */
.card-date-row {
    display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
    padding: 3px 0 2px; border-top: 1px solid #f1f5f9; border-bottom: 1px solid #f1f5f9;
    margin: 2px 0;
}
.card-date-vals {
    display: flex; align-items: center; gap: 0; flex-wrap: wrap;
}
.card-date-item { font-size: .78rem; color: #475569; display: flex; align-items: center; gap: 2px; }
.card-date-sep  { color: #cbd5e1; margin: 0 6px; font-size: .8rem; }
.card-date-lbl  { color: #94a3b8; font-size: .68rem; text-transform: uppercase; letter-spacing: .03em; margin-right: 1px; }

/* ─── Data consegna nell'header ordine ─────────────────────────── */
.ord-hdr-date {
    display: inline-flex; align-items: center;
    font-size: .72rem; font-weight: 600;
    margin-top: 2px; white-space: nowrap;
}

/* ─── Qty evasa/rimanente inline (sempre visibile) ─────────────── */
.qty-rim-inline {
    display: inline-flex; align-items: center; gap: 3px;
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px;
    padding: 2px 8px; font-size: .78rem; margin-left: 6px; white-space: nowrap;
}
.qty-rimanente-val { font-weight: 700; font-size: .82rem; }

/* ─── Filtro avanzato — trigger button ─────────────────────────── */
.pf-wrap { position: relative; display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; }
.pf-trigger-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 13px; border: 1px solid #e2e8f0; border-radius: 8px;
    background: #fff; color: #64748b; font-size: .82rem; font-weight: 500;
    cursor: pointer; transition: border-color .15s, color .15s, box-shadow .15s;
    white-space: nowrap; user-select: none;
}
.pf-trigger-btn:hover { border-color: #94a3b8; color: #334155; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.pf-trigger-btn.pf-trigger-active { border-color: #6366f1; color: #6366f1; }
.pf-active-badge {
    background: #6366f1; color: #fff; border-radius: 999px;
    font-size: .65rem; font-weight: 700; padding: 1px 6px; min-width: 18px; text-align: center;
}
.pf-caret { font-size: .6rem; transition: transform .2s; }
.pf-reset-btn {
    width: 30px; height: 30px; border-radius: 8px; border: 1px solid #e2e8f0;
    background: #fff; color: #94a3b8; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; font-size: .75rem;
    transition: border-color .15s, color .15s;
}
.pf-reset-btn:hover { border-color: #fca5a5; color: #dc2626; }

/* ─── Filtro — dropdown panel ───────────────────────────────────── */
.pf-panel {
    position: absolute; top: calc(100% + 5px); left: 0; z-index: 9999;
    background: #fff; border: 1px solid #e8ecf0; border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,.12); min-width: 230px; max-width: 280px;
    padding: 6px 0; overflow: hidden;
}
.pf-panel-section { padding: 8px 14px; }
.pf-panel-title {
    font-size: .65rem; font-weight: 700; color: #94a3b8;
    text-transform: uppercase; letter-spacing: .07em; margin-bottom: 5px;
}
.pf-panel-sep { height: 1px; background: #f1f5f9; }
.pf-row {
    display: flex; align-items: center; gap: 9px;
    padding: 5px 4px; cursor: pointer; border-radius: 7px; user-select: none;
    transition: background .1s;
}
.pf-row:hover { background: #f8fafc; }
.pf-radio {
    width: 14px; height: 14px; border-radius: 50%; border: 2px solid #cbd5e1;
    flex-shrink: 0; transition: border-color .12s, background .12s;
}
.pf-radio-on { border-color: #6366f1; background: #6366f1; box-shadow: 0 0 0 2px #e0e7ff; }
.pf-check {
    width: 14px; height: 14px; border-radius: 4px; border: 2px solid #cbd5e1;
    flex-shrink: 0; display: flex; align-items: center; justify-content: center;
    transition: background .12s, border-color .12s;
}
.pf-check-on { background: #6366f1; border-color: #6366f1; }
.pf-stato-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pf-row-lbl { font-size: .82rem; color: #334155; line-height: 1.3; }

/* ─── Info ordine — overlay panel ──────────────────────────────── */
.iop-overlay {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.iop-box {
    background: #fff; border-radius: 16px; box-shadow: 0 16px 48px rgba(0,0,0,.18);
    width: min(680px, 100%); max-height: 80vh; display: flex; flex-direction: column;
    overflow: hidden;
}
.iop-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid #f1f5f9; flex-shrink: 0;
}
.iop-title { font-size: .92rem; font-weight: 700; color: #1e293b; }
.iop-close {
    width: 30px; height: 30px; border-radius: 8px; border: 1px solid #e2e8f0;
    background: #f8fafc; color: #64748b; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: .78rem;
}
.iop-close:hover { background: #fee2e2; border-color: #fca5a5; color: #dc2626; }
.iop-table-wrap { overflow: auto; flex: 1; padding: 12px 18px; }
.iop-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.iop-th {
    text-align: left; font-size: .65rem; font-weight: 700; color: #94a3b8;
    text-transform: uppercase; letter-spacing: .06em; padding: 0 10px 8px 0;
    border-bottom: 1px solid #f1f5f9; white-space: nowrap;
}
.iop-td { padding: 8px 10px 8px 0; border-bottom: 1px solid #f8fafc; color: #334155; vertical-align: middle; }
.iop-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: #0f172a; }
.iop-hint { font-size: .72rem; color: #94a3b8; padding: 8px 18px 12px; flex-shrink: 0; border-top: 1px solid #f8fafc; margin: 0; }
/* Tasto Sollecita (commerciali) */
.btn-sollecita {
    background: #d97706 !important;
    color: #ffffff !important;
    border: none !important;
    transition: background 0.2s, color 0.2s !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 12px !important;
    border-radius: 6px;
    font-size: 11px !important;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.btn-sollecita:hover { background: #b45309 !important; }
/* Tasto Ripristina (archivio ordine) */
.btn-ripristina {
    background: #242424!important;
    color: #ffffff !important;
    border: none !important;
    transition: background 0.2s, color 0.2s !important;
}
.btn-ripristina:hover {
    background: #ffffff !important;
    color: #242424!important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15) !important;
}

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

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




















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

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

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

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

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

















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

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

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

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

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

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    width: min(500px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    max-height: min(88dvh, calc(100dvh - 24px));
    box-shadow: 0 28px 56px -8px rgba(0,0,0,0.2), 0 0 0 1px rgba(0,0,0,0.04);
    opacity: 0;
    transform: scale(0.84) translateY(22px);
    overflow-y: auto;
}

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

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

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

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

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

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














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

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

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

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

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

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

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















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

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

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

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


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

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

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

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

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

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

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

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

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


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

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

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

/* â”€â”€â”€ GRUPPI RICHIESTE â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.req-groups {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 8px;
}
.req-group {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s;
}
.req-group[open] { box-shadow: 0 4px 16px rgba(0,0,0,0.07); }
.req-group-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    cursor: pointer;
    user-select: none;
    background: #f8fafc;
    border-bottom: 1px solid transparent;
    transition: background 0.15s;
    list-style: none;
}
.req-group-summary::-webkit-details-marker { display: none; }
.req-group[open] .req-group-summary { border-bottom-color: #e2e8f0; background: #f1f5f9; }
.req-group-summary:hover { background: #eff3f7; }
.rg-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.rg-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 900;
    flex-shrink: 0;
}
.rg-icon-assegna { background: #dcfce7; color: #16a34a; }
.rg-icon-domanda  { background: #fee2e2; color: #dc2626; }
.rg-icon-scadenza { background: #fef3c7; color: #d97706; }
.rg-icon-fabbisogno { background: #dbeafe; color: #1d4ed8; }
.rg-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.6px;
    color: #374151;
    text-transform: uppercase;
}
.rg-count, .rg-count-dom {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    background: #dcfce7;
    color: #15803d;
}
.rg-count-dom   { background: #fee2e2; color: #b91c1c; }
.rg-count-scad  { background: #fef3c7; color: #b45309; }
.rg-count-fabb  { background: #dbeafe; color: #1d4ed8; }
.rg-chevron {
    font-size: 11px;
    color: #94a3b8;
    transition: transform 0.25s ease;
}
.req-group[open] .rg-chevron { transform: rotate(180deg); }
.req-group .chat-inbox {
    padding: 12px 14px 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
}

/* ─── Fabbisogno produzione buttons ─────────────────────────────── */
.fabprod-sel-btn-wrap {
    margin-left: auto;
    margin-right: 8px;
    flex-shrink: 0;
}
.fabprod-actions-wrap {
    margin-left: auto;
    margin-right: 8px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.fabprod-sel-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f1f5f9;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    padding: 4px 12px 4px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.fabprod-sel-btn:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: #1e293b;
}
.fabprod-sel-btn.has-selection {
    background: #ede9fe;
    border-color: #c4b5fd;
    color: #5b21b6;
}
.fabprod-sel-badge {
    background: #7c3aed;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}
.fabprod-print-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #1e293b;
    border: 1.5px solid #1e293b;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.fabprod-print-btn:hover {
    background: #334155;
    border-color: #334155;
}
.fabprod-print-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.fabprod-empty-sel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 32px 16px;
    color: #94a3b8;
    text-align: center;
}
.fabprod-empty-sel-icon { font-size: 1.8rem; opacity: 0.5; }
.fabprod-empty-sel-text { font-size: 0.88rem; font-weight: 500; max-width: 220px; }
.fabprod-qty-breakdown {
    font-size: 0.74rem;
    color: #94a3b8;
    margin: 1px 0 4px;
    padding: 0 2px;
    line-height: 1.5;
}
.fabprod-sel-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 9100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.2s;
}
.fabprod-sel-modal-overlay--in { opacity: 1; }
.fabprod-sel-modal-box {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    transform: scale(0.96);
    transition: transform 0.2s;
}
.fabprod-sel-modal-overlay--in .fabprod-sel-modal-box { transform: scale(1); }
.fabprod-sel-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 12px;
    font-weight: 700;
    font-size: 0.95rem;
    color: #1e293b;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}
.fabprod-sel-modal-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1rem;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 8px;
    transition: color 0.15s, background 0.15s;
}
.fabprod-sel-modal-close:hover { background: #f1f5f9; color: #475569; }
.fabprod-sel-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}
.fabprod-sel-search-icon { color: #94a3b8; font-size: 0.82rem; flex-shrink: 0; }
.fabprod-sel-search {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.88rem;
    color: #1e293b;
    background: transparent;
    padding: 4px 0;
}
.fabprod-sel-search::placeholder { color: #cbd5e1; }
.fabprod-sel-modal-body {
    overflow-y: auto;
    padding: 8px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.fabprod-sel-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.12s;
    border: 1.5px solid transparent;
}
.fabprod-sel-item:hover { background: #f8fafc; }
.fabprod-sel-item--checked { background: #f1f5f9; border-color: #334155; }
.fabprod-sel-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #1e293b;
    flex-shrink: 0;
    cursor: pointer;
}
.fabprod-sel-item-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fabprod-sel-ord { font-size: 0.88rem; font-weight: 600; color: #1e293b; }
.fabprod-sel-cli {
    font-size: 0.78rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fabprod-sel-footer {
    display: flex;
    gap: 10px;
    padding: 12px 16px 20px;
    border-top: 1px solid #f1f5f9;
    flex-shrink: 0;
}
.fabprod-sel-btn-cancel {
    flex: 1;
    background: #f1f5f9;
    border: none;
    border-radius: 12px;
    padding: 11px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: background 0.15s;
}
.fabprod-sel-btn-cancel:hover { background: #e2e8f0; }
.fabprod-sel-btn-apply {
    flex: 2;
    background: #1e293b;
    border: none;
    border-radius: 12px;
    padding: 11px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s;
}
.fabprod-sel-btn-apply:hover { background: #334155; }

/* Kit lista: classi di supporto per riorganizzare l'header senza alterare il look desktop. */
.kit-summary-meta {
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 500;
    margin-left: 8px;
}
.kit-summary-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
    flex-shrink: 0;
}
.kit-summary-actions .kit-summary-btn {
    width: auto;
    min-width: 92px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border: none;
    font: inherit;
    white-space: nowrap;
}
.kit-summary-btn-label {
    line-height: 1;
}
.kit-summary-action-chip {
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(243, 238, 232, 0.96) 100%);
    color: #334155;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76), 0 10px 18px rgba(15, 23, 42, 0.06);
    cursor: pointer;
    transition: transform 0.15s, background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.kit-summary-action-chip i {
    font-size: 0.76rem;
    color: inherit;
}
.kit-summary-action-chip:hover {
    transform: translateY(-1px);
    border-color: rgba(15, 23, 42, 0.14);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    color: #0f172a;
    box-shadow: 0 14px 22px rgba(15, 23, 42, 0.1);
}
.kit-summary-action-chip--primary {
    background: linear-gradient(135deg, #0f172a 0%, #1f2937 100%);
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 14px 24px rgba(15, 23, 42, 0.16);
}
.kit-summary-action-chip--primary:hover {
    background: linear-gradient(135deg, #111827 0%, #334155 100%);
    color: #ffffff;
}
.kit-summary-action-chip--danger {
    background: linear-gradient(180deg, #fff1f2 0%, #ffe4e6 100%);
    border-color: rgba(244, 63, 94, 0.18);
    color: #be123c;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76), 0 10px 18px rgba(190, 24, 93, 0.08);
}
.kit-summary-action-chip--danger:hover {
    border-color: rgba(225, 29, 72, 0.26);
    background: linear-gradient(180deg, #ffe4e6 0%, #fecdd3 100%);
    color: #9f1239;
}
.kit-group-summary > .og-chevron {
    flex-shrink: 0;
    justify-self: end;
    align-self: center;
}

/* Mobile stretto: card e header passano a colonna per evitare overflow e bottoni schiacciati. */
@media (max-width: 900px) {
    .kit-page-shell {
        gap: 14px;
    }

    .kit-main-header,
    .kit-detail-hero,
    .kit-main-surface {
        padding: 18px 16px;
        border-radius: 22px;
    }

    .kit-main-heading-row,
    .kit-main-section,
    .kit-detail-toolbar {
        flex-direction: column;
    }

    .kit-main-hero {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .kit-main-mobile-overview {
        display: flex;
    }

    .kit-main-heading-row {
        margin-top: 0;
        gap: 12px;
    }

    .kit-main-heading-copy {
        max-width: none;
    }

    .kit-main-stats,
    .kit-main-summary-strip {
        min-width: 0;
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .kit-main-stats {
        display: none;
    }

    .kit-main-actions {
        margin-top: 0;
        justify-content: flex-start;
    }

    .kit-main-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding: 8px;
    }

    .kit-main-tab[data-tab="distinte"] {
        grid-column: 1 / -1;
    }

    .kit-main-tab {
        min-width: 0;
        flex: 1 1 auto;
        min-height: 58px;
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
        padding: 12px 14px;
    }

    .kit-main-tab-count {
        margin-left: auto;
    }

    .kit-main-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .kit-main-list .kit-main-group {
        min-width: 0;
        border-radius: 18px;
    }

    .kit-main-list .kit-main-group[open] {
        grid-column: 1 / -1;
    }

    .kit-main-list .kit-main-group:not([open]) .kit-group-summary {
        min-height: 96px;
        aspect-ratio: auto;
        padding: 14px 16px;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .kit-main-list .kit-main-group .kit-summary-pills {
        display: none;
    }

    .kit-main-list .kit-main-group > .kit-group-summary .kit-summary-actions {
        display: none;
    }

    .kit-main-list .kit-main-group .kit-summary-mobile-grid,
    .kit-main-list .kit-main-group .kit-summary-mobile-hint {
        display: none;
    }

    .kit-main-list .kit-main-group[open] .kit-summary-mobile-grid {
        display: grid;
        margin-top: 10px;
    }

    .kit-main-list .kit-main-group:not([open]) .kit-summary-left {
        width: auto;
        flex: 1;
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 12px;
        padding-right: 0;
    }

    .kit-main-list .kit-main-group:not([open]) .kit-summary-heading {
        flex: 1;
        min-width: 0;
        flex-wrap: nowrap;
        align-items: flex-start;
        gap: 12px;
    }

    .kit-main-list .kit-main-group:not([open]) .kit-summary-heading-copy {
        flex: 1;
        min-width: 0;
        gap: 6px;
    }

    .kit-main-list .kit-main-group:not([open]) .kit-summary-icon {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }

    .kit-main-list .kit-main-group:not([open]) .kit-summary-heading .og-operatore {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-size: 0.88rem;
        line-height: 1.3;
        white-space: normal;
    }

    .kit-main-list .kit-main-group:not([open]) .kit-summary-status {
        min-height: 24px;
        padding: 0 8px;
        font-size: 0.64rem;
        white-space: nowrap;
        align-self: flex-start;
    }

    .kit-main-list .kit-main-group:not([open]) .og-chevron {
        position: static;
        margin-left: 8px;
        transform: none;
    }

    .kit-component-head {
        display: none;
    }

    .kit-component-row {
        grid-template-columns: 1fr;
        padding: 12px 0;
    }

    .kit-component-controls {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .kit-component-delete {
        justify-self: stretch;
    }

    .kit-section-footer {
        justify-content: stretch;
    }

    .kit-section-footer .btn-archive-action {
        width: 100%;
        justify-content: center;
    }

    .kit-record-item {
        flex-direction: column;
    }

    .kit-record-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .kit-record-actions .btn-archive-action,
    .kit-record-actions .btn-trash-modern {
        flex: 1 1 140px;
        justify-content: center;
    }

    .kit-page-shell--detail .kit-order-layout--detail {
        grid-template-columns: 1fr;
    }

    .kit-page-shell--detail .kit-order-section--wide {
        grid-column: auto;
    }

    .kit-mobile-summary-stats {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        margin-top: 12px;
    }

    .kit-mobile-summary-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-top: 10px;
    }

    .kit-mobile-summary-actions--inline {
        margin: 4px 0 14px;
    }

    .kit-mobile-summary-actions--detail {
        margin-top: 12px;
    }

    .kit-order-summary-actions--desktop {
        display: none;
    }
}

@media (max-width: 640px) {
    .req-group-summary {
        position: relative;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 10px;
        padding: 14px 16px;
        padding-right: 42px;
    }

    .req-group-summary > .rg-chevron {
        position: absolute;
        top: 18px;
        right: 16px;
    }

    .rg-left {
        min-width: 0;
        max-width: 100%;
        padding-right: 8px;
    }

    .rg-title {
        line-height: 1.25;
    }

    .fabprod-actions-wrap {
        width: 100%;
        margin: 0;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .fabprod-actions-wrap > .fabprod-sel-btn,
    .fabprod-actions-wrap > .fabprod-print-btn {
        width: 100%;
        min-width: 0;
        justify-content: center;
        padding: 6px 10px;
        font-size: 0.74rem;
    }

    .fabprod-top {
        flex-wrap: wrap;
        gap: 6px;
    }

    .fabprod-name {
        min-width: 0;
        flex: 1 1 100%;
    }

    .fabprod-qty {
        margin-left: 0;
    }

    .req-group .chat-inbox {
        gap: 8px;
    }

    .req-card,
    .scad-card {
        width: 100%;
        min-width: 0;
    }

    .rc-top,
    .scad-top {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .rc-ordine-wrap,
    .scad-ordine-wrap {
        min-width: 0;
        flex: 1 1 100%;
    }

    .rc-ordine,
    .rc-cliente {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    .scad-date-badge {
        max-width: 100%;
        white-space: normal;
        line-height: 1.2;
    }

    .rc-foot {
        flex-wrap: wrap;
        gap: 6px;
    }

    .rc-actions {
        flex-wrap: wrap;
    }

    .of-riga-ordine {
        align-items: flex-start !important;
    }

    .of-riga-ordine > .flex-grow {
        width: 100%;
    }

    .of-riga-ordine .order-title {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        line-height: 1.3;
    }

    .of-riga-ordine > .order-info {
        width: 100% !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
    }

    .of-riga-ordine > .order-info > .badge-count,
    .of-riga-ordine > .order-info > .stato-dropdown-ord {
        flex: 1 1 calc(50% - 3px) !important;
    }

    .of-riga-ordine > .order-info > .badge-count .badge-ord-num {
        max-width: 90px !important;
    }

    .of-riga-ordine > .order-info > .of-data-badge {
        order: 3;
        flex: 1 1 100%;
        min-width: 0;
        white-space: normal;
        overflow-wrap: anywhere;
        line-height: 1.25;
    }

    .of-riga-ordine > .order-info > .of-progress-mini {
        order: 4;
        flex: 1 1 96px;
        width: auto;
        min-width: 96px;
    }

    .of-riga-ordine > .order-info > .dettagli-chevron {
        order: 5;
        margin-left: auto;
    }

    .of-modal-grid {
        grid-template-columns: 1fr;
    }

    .kit-page {
        padding: 10px 12px 84px;
    }

    .kit-page-shell {
        gap: 12px;
    }

    .kit-main-header,
    .kit-main-surface {
        padding: 14px 12px;
        border-radius: 20px;
    }

    .kit-main-mobile-overview {
        margin-top: 0;
    }

    .kit-main-mobile-badge {
        padding: 5px 8px;
        font-size: 0.68rem;
    }

    .kit-main-eyebrow,
    .kit-main-stats,
    .kit-main-summary-strip,
    .kit-main-section-text,
    .kit-order-summary-note,
    .kit-order-meta-help,
    .kit-order-summary-badges {
        display: none;
    }

    .kit-main-title {
        font-size: 1.32rem;
    }

    .kit-main-subtitle {
        display: none;
    }

    .kit-main-section {
        gap: 8px;
        padding: 0 0 6px;
        border-bottom: none;
    }

    .kit-main-section-title {
        margin: 0;
        font-size: 1rem;
    }

    .kit-main-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding: 4px;
    }

    .kit-main-tab {
        min-height: 54px;
        padding: 11px 12px;
    }

    .kit-main-tab-hint {
        display: none;
    }

    .kit-main-tab-label {
        gap: 6px;
        font-size: 0.78rem;
    }

    .kit-main-actions,
    .kit-main-actions .btn-modal-send,
    .kit-main-actions .kit-main-note {
        width: 100%;
    }

    .kit-main-actions .btn-modal-send,
    .kit-main-actions .kit-main-note {
        justify-content: center;
    }

    .kit-main-actions {
        justify-content: stretch;
    }

    .kit-detail-heading-row .kit-view-nome {
        font-size: 1.24rem;
    }

    .kit-detail-meta {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .kit-detail-meta::-webkit-scrollbar {
        display: none;
    }

    .kit-detail-meta .kit-summary-pill--strong {
        white-space: nowrap;
    }

    .kit-main-list {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .kit-main-list .kit-main-group:not([open]) .kit-group-summary {
        min-height: 88px;
        padding: 12px 14px;
    }

    .kit-main-list .kit-main-group:not([open]) .kit-summary-icon {
        width: 36px;
        height: 36px;
    }

    .kit-main-list .kit-main-group:not([open]) .kit-summary-heading .og-operatore {
        font-size: 0.82rem;
    }

    .kit-main-list .kit-main-group[open] .kit-summary-mobile-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .kit-mobile-summary-stats {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        margin-top: 12px;
    }

    .kit-mobile-summary-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-top: 10px;
    }

    .kit-mobile-summary-actions--inline {
        margin: 2px 0 12px;
    }

    .kit-mobile-summary-actions--detail {
        margin-top: 12px;
    }

    .kit-order-summary-actions--desktop {
        display: none;
    }

    .kit-record-subtitle {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .kit-component-row {
        gap: 10px;
        padding: 12px;
        border: 1px solid #e2e8f0;
        border-radius: 14px;
        background: #f8fafc;
    }

    .kit-component-row + .kit-component-row {
        margin-top: 8px;
    }

    .kit-component-row:last-child {
        border-bottom: 1px solid #e2e8f0;
    }

    .kit-component-controls {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .kit-component-field-label {
        display: block;
    }

    .kit-component-delete {
        grid-column: 1 / -1;
    }

    .kit-component-delete span {
        display: inline;
    }

    .kit-page-header,
    .kit-view-header {
        flex-wrap: wrap;
        align-items: center;
    }

    .kit-page-title,
    .kit-view-nome {
        min-width: 0;
    }

    .kit-nuovo-btn,
    .kit-nuevo-btn {
        width: 100%;
        justify-content: center;
    }

    .kit-group-summary {
        display: flex;
        position: relative;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 10px;
        padding-right: 42px;
    }

    .kit-group-summary .og-chevron {
        position: absolute;
        top: 18px;
        right: 16px;
    }

    .kit-summary-left {
        width: 100%;
        min-width: 0;
        padding-right: 8px;
    }

    .kit-summary-left .og-operatore {
        display: block;
        line-height: 1.3;
    }

    .kit-summary-meta {
        display: block;
        width: 100%;
        margin: 4px 0 0;
    }

    .kit-summary-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .kit-summary-actions .kit-summary-btn {
        width: 100%;
        min-width: 0;
        justify-content: center;
    }

    .kit-main-list .kit-main-group:not([open]) .kit-group-summary {
        padding-right: 14px;
        align-items: center;
    }

    .kit-main-list .kit-main-group:not([open]) .kit-summary-left {
        width: auto;
        flex: 1;
        padding-right: 0;
    }

    .kit-main-list .kit-main-group:not([open]) .kit-group-summary .og-chevron {
        position: static;
        top: auto;
        right: auto;
        margin-left: 8px;
    }

    .kit-order-summary-top {
        flex-direction: column;
    }

    .kit-order-summary-total {
        font-size: 1.5rem;
    }

    .kit-order-summary-actions {
        width: 100%;
        justify-content: stretch;
    }

    .kit-order-summary-actions .kit-btn-secondary,
    .kit-order-summary-actions .kit-cfg-add-btn,
    .kit-order-summary-actions .kit-spedisci-btn {
        width: 100%;
        justify-content: center;
    }

    .kit-order-meta-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 420px) {
    .kit-component-controls {
        grid-template-columns: 1fr;
    }

    .kit-component-delete {
        grid-column: auto;
    }

    .kit-mobile-summary-stats,
    .kit-mobile-summary-actions {
        grid-template-columns: 1fr;
    }

    .kit-section-card-summary {
        gap: 10px;
    }

    .kit-section-card-actions {
        gap: 6px;
    }
}

/* ─── Scadenze → Fabbisogno buttons ─────────────────────────────── */
.scad-actions-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    margin-right: 8px;
}
.scad-fab-btn {
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #334155;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all .15s ease;
}
.scad-fab-btn:hover { background: #f8fafc; border-color: #94a3b8; }
.scad-fab-btn:disabled { opacity: .55; cursor: not-allowed; }
.scad-fab-pick {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: auto;
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    user-select: none;
    cursor: pointer;
}
.scad-fab-pick .scad-fab-chk {
    width: 15px;
    height: 15px;
    accent-color: #1e293b;
}
.scad-fab-pick .scad-fab-chk:checked + span { color: #0f172a; }

/* Richieste redesign: override scoped alla pagina per riallineare il layout alla nuova Produzione. */
.req-page-shell {
    gap: 20px;
}

.req-page-hero {
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at top right, rgba(255,255,255,0.14), transparent 42%), linear-gradient(135deg, #111111 0%, #1f2937 56%, #101828 100%);
}

.req-page-hero::after {
    content: "";
    position: absolute;
    right: 18px;
    bottom: 18px;
    width: 112px;
    height: 112px;
    border-radius: 999px;
    background: rgba(255,255,255,0.07);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}

.req-groups-section {
    gap: 16px;
}

.req-groups-head {
    align-items: flex-end;
}

.req-groups-subtitle {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 0.92rem;
    line-height: 1.45;
    max-width: 56ch;
}

.req-page-actions {
    flex-wrap: wrap;
    gap: 10px;
}

.req-archive-btn {
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(15,23,42,0.08);
    background: #ffffff;
    color: #111827;
    font-size: 0.78rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(15,23,42,0.06);
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.req-archive-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(15,23,42,0.14);
    box-shadow: 0 14px 24px rgba(15,23,42,0.08);
}

.req-page-shell .req-groups {
    gap: 14px;
    margin-bottom: 0;
}

.req-page-shell .req-group {
    border-radius: 24px;
    border-color: rgba(15,23,42,0.08);
    box-shadow: 0 18px 36px rgba(15,23,42,0.06);
    background: linear-gradient(180deg, #ffffff 0%, #fbfbfa 100%);
}

.req-page-shell .req-group[open] {
    box-shadow: 0 22px 44px rgba(15,23,42,0.09);
}

.req-page-shell .req-group-summary {
    gap: 12px;
    padding: 18px 20px;
    background: linear-gradient(180deg, rgba(248,250,252,0.98), rgba(242,245,248,0.96));
    border-bottom: 1px solid transparent;
}

.req-page-shell .req-group[open] .req-group-summary {
    border-bottom-color: rgba(15,23,42,0.08);
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.req-page-shell .req-group-summary:hover {
    background: linear-gradient(180deg, #f7fafc 0%, #eef2f7 100%);
}

.req-page-shell .rg-left {
    flex: 1 1 auto;
    min-width: 0;
    gap: 14px;
}

.req-page-shell .rg-heading {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.req-page-shell .rg-title {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: #0f172a;
}

.req-page-shell .rg-meta {
    color: #64748b;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.35;
    max-width: 48ch;
}

.req-page-shell .rg-icon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    font-size: 14px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 10px 18px rgba(15,23,42,0.07);
}

.req-page-shell .rg-count,
.req-page-shell .rg-count-dom,
.req-page-shell .rg-count-scad,
.req-page-shell .rg-count-fabb {
    min-height: 30px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(15,23,42,0.05);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
    font-size: 0.72rem;
    font-weight: 800;
}

.req-page-shell .rg-chevron {
    font-size: 12px;
    color: #64748b;
}

.req-page-shell .fabprod-actions-wrap,
.req-page-shell .scad-actions-wrap {
    gap: 8px;
}

.req-page-shell .fabprod-sel-btn,
.req-page-shell .fabprod-print-btn,
.req-page-shell .scad-fab-btn {
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.75);
}

.req-page-shell .fabprod-sel-btn {
    border-color: rgba(15,23,42,0.08);
    background: #ffffff;
    color: #334155;
}

.req-page-shell .fabprod-sel-btn:hover {
    background: #f8fafc;
    border-color: rgba(15,23,42,0.14);
}

.req-page-shell .fabprod-sel-btn.has-selection {
    background: #eef2ff;
    border-color: rgba(99,102,241,0.22);
    color: #4338ca;
}

.req-page-shell .fabprod-print-btn {
    background: #111111;
    border-color: #111111;
    color: #ffffff;
}

.req-page-shell .rg-icon-archive {
    background: #e2e8f0;
    color: #334155;
}

.req-page-shell .rg-count-archive {
    background: #e2e8f0;
    color: #334155;
}

.req-page-shell .scad-fab-btn {
    border-color: rgba(15,23,42,0.08);
    color: #334155;
}

.req-page-shell .req-group .chat-inbox,
.req-page-shell .req-archive-panel .chat-inbox {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.req-page-shell .fabprod-list {
    padding: 16px 18px 18px;
    gap: 10px;
}

.req-page-shell .fabprod-card {
    border-radius: 18px;
    border-color: rgba(59,130,246,0.16);
    padding: 14px 15px;
    box-shadow: 0 14px 28px rgba(29,78,216,0.08);
    background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
}

.req-page-shell .fabprod-qty {
    padding: 5px 10px;
    font-size: 0.78rem;
}

.req-page-shell .req-card,
.req-page-shell .scad-card {
    width: 100%;
    min-width: 0;
    padding: 18px;
    border-radius: 20px;
    gap: 14px;
    border-color: rgba(15,23,42,0.08);
    box-shadow: 0 14px 30px rgba(15,23,42,0.07);
    background: linear-gradient(180deg, #ffffff 0%, #fcfcfb 100%);
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.req-page-shell .req-card:hover,
.req-page-shell .scad-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 36px rgba(15,23,42,0.09);
    border-color: rgba(99,102,241,0.22);
}

.req-page-shell .req-card.archiviata {
    opacity: 0.92;
    border-color: rgba(148,163,184,0.28);
    background: linear-gradient(180deg, #fbfbfc 0%, #f8fafc 100%);
}

.req-page-shell .req-card.sollecitata {
    border-color: #fecaca;
    box-shadow: 0 0 0 1px rgba(239,68,68,0.08), 0 18px 38px rgba(239,68,68,0.08);
}

.req-page-shell .scad-card {
    background: linear-gradient(180deg, #fffdf7 0%, #fffaf0 100%);
}

.req-page-shell .scad-card.scad-vicina {
    background: linear-gradient(180deg, #fffaf0 0%, #fff7ed 100%);
}

.req-page-shell .scad-card.scad-urgente {
    background: linear-gradient(180deg, #fff7f7 0%, #fff1f2 100%);
}

.req-page-shell .scad-card.scad-scaduta {
    opacity: 1;
    background: linear-gradient(180deg, #fff1f2 0%, #ffe4e6 100%);
}

.req-page-shell .rc-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.req-page-shell .rc-head-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.req-page-shell .rc-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.req-page-shell .rc-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(15,23,42,0.08);
    background: #f8fafc;
    color: #0f172a;
    font-size: 0.75rem;
    font-weight: 800;
}

.req-page-shell .rc-type-badge-scad {
    background: #fffaf0;
}

.req-page-shell .rc-type-badge .rc-tipo {
    width: 22px;
    height: 22px;
    border-radius: 8px;
    font-size: 0.7rem;
}

.req-page-shell .rc-ref-chip {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid rgba(15,23,42,0.08);
    color: #475569;
    font-size: 0.72rem;
    font-weight: 700;
}

.req-page-shell .rc-statuses {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.req-page-shell .badge-sollecito-sm,
.req-page-shell .rc-arch-badge {
    min-height: 30px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
}

.req-page-shell .rc-top {
    justify-content: flex-start;
}

.req-page-shell .rc-ordine-wrap {
    gap: 8px;
}

.req-page-shell .rc-ordine {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0.01em;
}

.req-page-shell .rc-cliente {
    color: #1f2937;
    font-size: 1.06rem;
    font-weight: 800;
    white-space: normal;
}

.req-page-shell .rc-info {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.req-page-shell .rc-info-card {
    gap: 8px;
    align-items: flex-start;
    padding: 12px 13px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid rgba(15,23,42,0.06);
}

.req-page-shell .rc-lbl {
    width: auto;
    font-size: 0.68rem;
    letter-spacing: 0.12em;
}

.req-page-shell .rc-preview {
    padding: 14px 15px;
    border-radius: 18px;
    border: 1px solid rgba(15,23,42,0.06);
    background: linear-gradient(180deg, #fbfbfa 0%, #f6f7f9 100%);
}

.req-page-shell .rc-preview-label {
    display: block;
    margin-bottom: 6px;
    color: #94a3b8;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.req-page-shell .rc-preview-text,
.req-page-shell .scad-nota {
    color: #334155;
    font-size: 0.95rem;
    line-height: 1.55;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.req-page-shell .rc-foot {
    margin-top: 0;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}

.req-page-shell .rc-foot-scad {
    justify-content: space-between;
}

.req-page-shell .rc-date-chip,
.req-page-shell .rc-msgcount {
    min-height: 32px;
    padding: 0 11px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid rgba(15,23,42,0.08);
    color: #475569;
    font-size: 0.76rem;
    font-weight: 700;
}

.req-page-shell .rc-date-chip {
    white-space: nowrap;
}

.req-page-shell .rc-msgcount-task {
    background: #eff6ff;
    border-color: rgba(59,130,246,0.16);
    color: #1d4ed8;
}

.req-page-shell .rc-expand-btn {
    min-height: 42px;
    padding: 0 14px;
    border-radius: 14px;
    border-color: rgba(59,130,246,0.16);
    background: #ffffff;
    color: #1d4ed8;
    font-size: 0.82rem;
    font-weight: 800;
}

.req-page-shell .rc-expand-btn:hover,
.req-page-shell .rc-expand-btn.open {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: rgba(59,130,246,0.24);
}

.req-page-shell .rc-body {
    padding-top: 14px;
    margin-top: 2px;
    gap: 10px;
}

.req-page-shell .chat-bubble {
    max-width: min(82%, 720px);
    padding: 12px 14px;
    border-radius: 18px;
    box-shadow: 0 10px 18px rgba(15,23,42,0.08);
}

.req-page-shell .chat-bubble-wrapper.received .chat-bubble {
    border-radius: 18px 18px 18px 6px;
}

.req-page-shell .chat-bubble-wrapper.sent .chat-bubble {
    border-radius: 18px 18px 6px 18px;
}

.req-page-shell .chat-bubble-name {
    margin-bottom: 5px;
    font-size: 0.68rem;
    letter-spacing: 0.1em;
}

.req-page-shell .chat-bubble-text {
    font-size: 0.92rem;
    line-height: 1.55;
}

.req-page-shell .chat-bubble-time {
    font-size: 0.68rem;
}

.req-page-shell .req-card .box-risposta {
    padding: 14px;
    border-top: 1px solid rgba(15,23,42,0.08);
    border-radius: 18px;
    background: #f8fafc;
}

.req-page-shell .req-card .reply-input {
    min-height: 84px;
    padding: 11px 12px;
    border-radius: 14px;
    border: 1px solid rgba(15,23,42,0.08);
    background: #ffffff;
    font-size: 0.92rem;
}

.req-page-shell .req-card .reply-footer {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.req-page-shell .req-card .btn-reply-send {
    width: auto;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    background: #111111;
}

.req-page-shell .rc-actions {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.req-page-shell .rc-btn {
    width: auto;
    height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    font-size: 0.78rem;
    font-weight: 800;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
}

.req-page-shell .rc-btn-reply {
    background: #111111;
    color: #ffffff;
}

.req-page-shell .rc-btn-reply:hover {
    background: #1f2937;
    color: #ffffff;
}

.req-page-shell .rc-btn-arch {
    background: #f0fdf4;
    border-color: rgba(34,197,94,0.14);
    color: #166534;
}

.req-page-shell .rc-btn-arch:hover {
    background: #dcfce7;
    color: #166534;
}

.req-page-shell .rc-btn-soll {
    background: #fff7ed;
    border-color: rgba(249,115,22,0.16);
    color: #c2410c;
}

.req-page-shell .rc-btn-soll:hover {
    background: #ffedd5;
    color: #9a3412;
}

.req-page-shell .rc-btn-scad {
    background: #eff6ff;
    border-color: rgba(59,130,246,0.16);
    color: #1d4ed8;
}

.req-page-shell .rc-btn-scad:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

.req-page-shell .scad-status-label {
    min-height: 30px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
}

.req-page-shell .scad-status-label.scad-ok {
    background: #fef9c3;
    color: #854d0e;
}

.req-page-shell .scad-status-label.scad-vicina {
    background: #fed7aa;
    color: #9a3412;
}

.req-page-shell .scad-status-label.scad-urgente {
    background: #fecaca;
    color: #991b1b;
}

.req-page-shell .scad-status-label.scad-scaduta {
    background: #fda4af;
    color: #881337;
}

.req-page-shell .scad-top {
    justify-content: flex-start;
}

.req-page-shell .scad-ordine-wrap {
    gap: 8px;
}

.req-page-shell .scad-date-badge {
    min-height: 36px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    font-size: 0.78rem;
    font-weight: 800;
}

.req-page-shell .scad-preview {
    background: rgba(255,255,255,0.7);
}

.req-page-shell .scad-fab-pick {
    min-height: 38px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(15,23,42,0.08);
    background: #ffffff;
}

.req-page-shell .req-archive-panel {
    border-radius: 22px;
    border: 1px solid rgba(15,23,42,0.08);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 18px 36px rgba(15,23,42,0.06);
    overflow: hidden;
}

.req-page-shell .req-archive-summary {
    justify-content: space-between;
    padding: 18px 20px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.req-page-shell .req-archive-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.req-page-shell .req-archive-kicker {
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.req-page-shell .req-archive-title {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 900;
}

.req-page-shell .req-archive-side {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.req-page-shell .req-archive-count {
    min-width: 34px;
    height: 34px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #111111;
    color: #ffffff;
    font-size: 0.76rem;
    font-weight: 800;
}

.req-loading-card {
    min-height: 220px;
    padding: 32px;
    border-radius: 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    color: #ffffff;
    background: radial-gradient(circle at top right, rgba(255,255,255,0.14), transparent 40%), linear-gradient(135deg, #111111 0%, #1f2937 55%, #101828 100%);
    box-shadow: 0 24px 48px rgba(15,23,42,0.12);
}

.req-loading-card-error {
    background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 40%, #111827 100%);
}

.req-loading-kicker {
    color: rgba(255,255,255,0.68);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.req-loading-title {
    font-size: 1.55rem;
    font-weight: 900;
    line-height: 1.1;
}

.req-loading-text {
    max-width: 42ch;
    color: rgba(255,255,255,0.82);
    font-size: 0.94rem;
    line-height: 1.5;
}

.req-loader-retry-btn {
    margin-top: 6px;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 999px;
    background: rgba(255,255,255,0.1);
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    cursor: pointer;
    transition: background 0.16s ease, transform 0.16s ease;
}

.req-loader-retry-btn:hover {
    background: rgba(255,255,255,0.16);
    transform: translateY(-1px);
}

.req-mobile-quickbar,
.req-mobile-summary,
.req-label-mobile {
    display: none;
}

.req-mobile-quickbar {
    gap: 10px;
}

.req-mobile-quickbtn {
    min-width: 98px;
    min-height: 64px;
    padding: 12px 14px;
    border: 1px solid rgba(15,23,42,0.08);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 12px 24px rgba(15,23,42,0.06);
    color: #0f172a;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.req-mobile-quickbtn:hover {
    transform: translateY(-1px);
    border-color: rgba(15,23,42,0.14);
    box-shadow: 0 16px 28px rgba(15,23,42,0.08);
}

.req-mobile-quickbtn i {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #111111;
    color: #ffffff;
    font-size: 0.8rem;
}

.req-mobile-quicklabel {
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.15;
}

.req-mobile-quickcount {
    min-width: 26px;
    height: 26px;
    padding: 0 8px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.72rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.req-mobile-summary {
    gap: 8px;
    flex-wrap: wrap;
}

.req-mobile-summary-chip {
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid rgba(15,23,42,0.08);
    color: #475569;
    font-size: 0.74rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
}

.req-mobile-summary-chip span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 769px) {
    /* Richieste desktop/tablet: stessa gerarchia visiva, meno volume inutile. */
    body.page-richieste .req-page-shell {
        gap: 16px;
    }

    body.page-richieste .req-page-toolbar {
        gap: 12px;
    }

    body.page-richieste .req-page-hero::after {
        right: 16px;
        bottom: 16px;
        width: 96px;
        height: 96px;
    }

    body.page-richieste .req-groups-section {
        gap: 14px;
    }

    body.page-richieste .req-groups-head {
        gap: 10px;
    }

    body.page-richieste .req-groups-subtitle {
        font-size: 0.84rem;
    }

    body.page-richieste .req-page-actions {
        gap: 8px;
    }

    body.page-richieste .req-archive-btn {
        min-height: 32px;
        padding: 0 12px;
        font-size: 0.72rem;
    }

    body.page-richieste .req-page-shell .req-groups {
        gap: 12px;
    }

    body.page-richieste .req-page-shell .req-group {
        border-radius: 20px;
        box-shadow: 0 14px 28px rgba(15,23,42,0.06);
    }

    body.page-richieste .req-page-shell .req-group[open] {
        box-shadow: 0 18px 34px rgba(15,23,42,0.09);
    }

    body.page-richieste .req-page-shell .req-group-summary {
        gap: 10px;
        padding: 16px 18px;
    }

    body.page-richieste .req-page-shell .rg-left {
        gap: 12px;
    }

    body.page-richieste .req-page-shell .rg-title {
        font-size: 0.72rem;
    }

    body.page-richieste .req-page-shell .rg-meta {
        font-size: 0.82rem;
        max-width: 44ch;
    }

    body.page-richieste .req-page-shell .rg-icon {
        width: 36px;
        height: 36px;
        border-radius: 12px;
        font-size: 13px;
    }

    body.page-richieste .req-page-shell .rg-count,
    body.page-richieste .req-page-shell .rg-count-dom,
    body.page-richieste .req-page-shell .rg-count-scad,
    body.page-richieste .req-page-shell .rg-count-fabb {
        min-height: 28px;
        padding: 0 10px;
        font-size: 0.68rem;
    }

    body.page-richieste .req-page-shell .fabprod-sel-btn,
    body.page-richieste .req-page-shell .fabprod-print-btn,
    body.page-richieste .req-page-shell .scad-fab-btn {
        min-height: 34px;
        padding: 0 12px;
        font-size: 0.72rem;
    }

    body.page-richieste .req-page-shell .req-group .chat-inbox,
    body.page-richieste .req-page-shell .req-archive-panel .chat-inbox,
    body.page-richieste .req-page-shell .fabprod-list {
        padding: 14px 16px 16px;
    }

    body.page-richieste .req-page-shell .fabprod-card {
        padding: 12px 13px;
        border-radius: 16px;
        box-shadow: 0 10px 20px rgba(29,78,216,0.08);
    }

    body.page-richieste .req-page-shell .fabprod-qty {
        font-size: 0.72rem;
    }

    body.page-richieste .req-page-shell .req-card,
    body.page-richieste .req-page-shell .scad-card {
        padding: 16px;
        border-radius: 18px;
        gap: 12px;
        box-shadow: 0 12px 24px rgba(15,23,42,0.07);
    }

    body.page-richieste .req-page-shell .req-card:hover,
    body.page-richieste .req-page-shell .scad-card:hover {
        box-shadow: 0 16px 30px rgba(15,23,42,0.09);
    }

    body.page-richieste .req-page-shell .rc-meta-row,
    body.page-richieste .req-page-shell .rc-ordine-wrap,
    body.page-richieste .req-page-shell .rc-statuses,
    body.page-richieste .req-page-shell .rc-foot {
        gap: 7px;
    }

    body.page-richieste .req-page-shell .rc-ordine {
        font-size: 0.96rem;
    }

    body.page-richieste .req-page-shell .rc-cliente {
        font-size: 1rem;
    }

    body.page-richieste .req-page-shell .rc-info {
        gap: 8px;
    }

    body.page-richieste .req-page-shell .rc-info-card {
        gap: 7px;
        padding: 11px 12px;
        border-radius: 14px;
    }

    body.page-richieste .req-page-shell .rc-preview {
        padding: 12px 13px;
        border-radius: 16px;
    }

    body.page-richieste .req-page-shell .rc-preview-text,
    body.page-richieste .req-page-shell .scad-nota {
        font-size: 0.9rem;
    }

    body.page-richieste .req-page-shell .rc-date-chip,
    body.page-richieste .req-page-shell .rc-msgcount,
    body.page-richieste .req-page-shell .scad-status-label,
    body.page-richieste .req-page-shell .scad-date-badge,
    body.page-richieste .req-page-shell .req-archive-count {
        font-size: 0.72rem;
    }

    body.page-richieste .req-page-shell .rc-expand-btn {
        min-height: 38px;
        padding: 0 12px;
        font-size: 0.78rem;
    }

    body.page-richieste .req-page-shell .rc-body {
        padding-top: 12px;
        gap: 8px;
    }

    body.page-richieste .req-page-shell .chat-bubble {
        padding: 11px 12px;
        border-radius: 16px;
        box-shadow: 0 8px 14px rgba(15,23,42,0.08);
    }

    body.page-richieste .req-page-shell .chat-bubble-wrapper.received .chat-bubble {
        border-radius: 16px 16px 16px 6px;
    }

    body.page-richieste .req-page-shell .chat-bubble-wrapper.sent .chat-bubble {
        border-radius: 16px 16px 6px 16px;
    }

    body.page-richieste .req-page-shell .chat-bubble-text {
        font-size: 0.88rem;
    }

    body.page-richieste .req-page-shell .req-card .box-risposta {
        padding: 12px;
        border-radius: 16px;
    }

    body.page-richieste .req-page-shell .req-card .reply-input {
        min-height: 78px;
        font-size: 0.88rem;
    }

    body.page-richieste .req-page-shell .req-card .btn-reply-send,
    body.page-richieste .req-page-shell .rc-btn,
    body.page-richieste .req-page-shell .scad-fab-pick {
        min-height: 36px;
        font-size: 0.74rem;
    }

    body.page-richieste .req-page-shell .rc-btn {
        height: 36px;
        padding: 0 12px;
        gap: 7px;
    }

    body.page-richieste .req-page-shell .req-archive-panel {
        border-radius: 20px;
        box-shadow: 0 14px 28px rgba(15,23,42,0.06);
    }

    body.page-richieste .req-page-shell .req-archive-summary {
        padding: 16px 18px;
    }

    body.page-richieste .req-loading-card {
        min-height: 200px;
        padding: 26px;
        border-radius: 24px;
    }
}

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

    .req-groups-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .req-page-actions {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 768px) {
    .req-page-toolbar,
    .req-groups-head,
    .req-mobile-quickbar {
        display: none;
    }

    .req-page-shell {
        gap: 14px;
    }

    .req-groups-section {
        gap: 0;
    }

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

    .req-page-shell .req-group,
    .req-page-shell .req-group-archive {
        min-width: 0;
        border-radius: 18px;
        transform-origin: top center;
        transition: box-shadow 0.24s ease, border-color 0.24s ease, transform 0.2s ease;
    }

    .req-page-shell .req-group[open],
    .req-page-shell .req-group-archive[open] {
        grid-column: 1 / -1;
        animation: req-mobile-card-open 0.24s cubic-bezier(0.22, 1, 0.36, 1);
    }

    .req-page-shell .req-group:not([open]) .req-group-summary {
        min-height: 124px;
        aspect-ratio: 1 / 1;
        padding: 14px;
        flex-direction: column;
        align-items: flex-start;
        justify-content: space-between;
        gap: 10px;
        border-bottom: none;
        position: relative;
    }

    .req-page-shell .req-group-summary {
        transition: background 0.22s ease, transform 0.18s ease, border-color 0.22s ease, box-shadow 0.22s ease;
        will-change: transform;
    }

    .req-page-shell .req-group-summary:active {
        transform: scale(0.985);
    }

    .req-page-shell .req-group .chat-inbox,
    .req-page-shell .req-archive-panel .chat-inbox,
    .req-page-shell .fabprod-list {
        overflow: hidden;
        transform-origin: top center;
        transition: max-height 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.18s ease, transform 0.22s ease, padding 0.22s ease;
    }

    .req-page-shell .req-group:not([open]) .chat-inbox,
    .req-page-shell .req-group:not([open]) .fabprod-list,
    .req-page-shell .req-group-archive:not([open]) .chat-inbox {
        max-height: 0;
        opacity: 0;
        transform: translateY(-8px);
        padding-top: 0;
        padding-bottom: 0;
        pointer-events: none;
    }

    .req-page-shell .req-group[open] .chat-inbox,
    .req-page-shell .req-group[open] .fabprod-list,
    .req-page-shell .req-group-archive[open] .chat-inbox {
        max-height: 2400px;
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    .req-page-shell .req-group:not([open]) .rg-left {
        width: 100%;
        min-width: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding-right: 0;
    }

    .req-page-shell .req-group:not([open]) .rg-heading {
        width: 100%;
        gap: 5px;
    }

    .req-page-shell .req-group:not([open]) .rg-title {
        font-size: 0.8rem;
        line-height: 1.25;
        white-space: normal;
    }

    .req-page-shell .req-group:not([open]) .rg-meta,
    .req-page-shell .req-group:not([open]) .fabprod-actions-wrap,
    .req-page-shell .req-group:not([open]) .scad-actions-wrap {
        display: none;
    }

    .req-page-shell .req-group:not([open]) .rg-icon {
        width: 38px;
        height: 38px;
        border-radius: 12px;
        font-size: 0.82rem;
    }

    .req-page-shell .req-group:not([open]) .rg-count,
    .req-page-shell .req-group:not([open]) .rg-count-dom,
    .req-page-shell .req-group:not([open]) .rg-count-scad,
    .req-page-shell .req-group:not([open]) .rg-count-fabb {
        min-height: 28px;
        padding: 0 10px;
        font-size: 0.68rem;
    }

    .req-page-shell .req-group:not([open]) .rg-chevron {
        position: absolute;
        right: 14px;
        bottom: 14px;
        top: auto;
        transform: none;
    }

    .req-page-shell .req-group-summary {
        padding: 16px;
        padding-right: 44px;
        gap: 10px;
    }

    .req-page-shell .rg-heading,
    .req-groups-subtitle,
    .req-page-shell .rg-meta {
        max-width: none;
    }

    .req-page-shell .req-card,
    .req-page-shell .scad-card {
        padding: 16px;
        gap: 12px;
    }

    .req-page-shell .rc-head {
        flex-direction: column;
    }

    .req-page-shell .rc-statuses {
        justify-content: flex-start;
    }

    .req-page-shell .rc-info {
        grid-template-columns: 1fr;
    }

    .req-page-shell .fabprod-actions-wrap {
        width: 100%;
        margin: 0;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .req-page-shell .fabprod-actions-wrap > .fabprod-sel-btn,
    .req-page-shell .fabprod-actions-wrap > .fabprod-print-btn,
    .req-page-shell .scad-actions-wrap > .scad-fab-btn {
        width: 100%;
        min-width: 0;
        justify-content: center;
        padding: 0 10px;
    }

    .req-page-shell .scad-actions-wrap {
        width: 100%;
        margin: 0;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .req-page-shell .req-card .reply-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .req-page-shell .req-card .btn-reply-send {
        width: 100%;
    }

    .req-page-shell .rc-btn {
        flex: 1 1 calc(50% - 4px);
    }

    .req-page-shell .scad-fab-pick {
        flex: 1 1 100%;
        justify-content: center;
    }
}

@keyframes req-mobile-card-open {
    0% {
        transform: scale(0.985);
    }
    100% {
        transform: scale(1);
    }
}

@media (max-width: 560px) {
    .req-page-shell .req-group {
        border-radius: 20px;
    }

    .kit-main-list {
        gap: 8px;
    }

    .kit-main-list .kit-main-group {
        border-radius: 20px;
    }

    .kit-main-list .kit-main-group:not([open]) .kit-group-summary {
        min-height: 112px;
        padding: 12px;
    }

    .kit-main-list .kit-main-group:not([open]) .kit-summary-icon {
        width: 34px;
        height: 34px;
        border-radius: 12px;
    }

    .kit-main-list .kit-main-group:not([open]) .kit-summary-heading .og-operatore {
        font-size: 0.72rem;
    }

    .kit-main-list .kit-main-group:not([open]) .kit-summary-status {
        font-size: 0.64rem;
        max-width: calc(100% - 28px);
    }

    .req-page-shell .req-groups {
        gap: 8px;
    }

    .req-page-shell .req-group:not([open]) .req-group-summary {
        min-height: 112px;
        padding: 12px;
    }

    .req-page-shell .req-group-summary {
        padding: 14px 14px 12px;
        padding-right: 40px;
        align-items: flex-start;
    }

    .req-page-shell .rg-left {
        gap: 10px;
        padding-right: 4px;
    }

    .req-page-shell .rg-icon {
        width: 34px;
        height: 34px;
        border-radius: 12px;
        font-size: 0.78rem;
    }

    .req-page-shell .rg-title {
        font-size: 0.72rem;
    }

    .req-page-shell .req-group[open] .rg-meta {
        display: none;
    }

    .req-page-shell .fabprod-actions-wrap,
    .req-page-shell .scad-actions-wrap {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .req-page-shell .fabprod-sel-btn,
    .req-page-shell .fabprod-print-btn,
    .req-page-shell .scad-fab-btn {
        min-height: 34px;
        font-size: 0.7rem;
        gap: 6px;
        padding: 0 9px;
    }

    .req-label-desktop {
        display: none;
    }

    .req-label-mobile {
        display: inline;
    }

    .req-page-shell .req-card,
    .req-page-shell .scad-card {
        padding: 14px;
        border-radius: 18px;
        gap: 10px;
    }

    .req-page-shell .rc-meta-row {
        gap: 6px;
    }

    .req-page-shell .rc-type-badge,
    .req-page-shell .scad-status-label,
    .req-page-shell .rc-ref-chip,
    .req-page-shell .badge-sollecito-sm,
    .req-page-shell .rc-arch-badge,
    .req-page-shell .rc-date-chip,
    .req-page-shell .rc-msgcount {
        min-height: 28px;
        padding: 0 9px;
        font-size: 0.68rem;
    }

    .req-page-shell .rc-ref-chip {
        display: none;
    }

    .req-page-shell .badge-sollecito-sm span,
    .req-page-shell .rc-arch-badge span {
        display: none;
    }

    .req-page-shell .rc-ordine {
        font-size: 0.92rem;
    }

    .req-page-shell .rc-cliente {
        font-size: 0.94rem;
        line-height: 1.35;
    }

    .req-page-shell .rc-info {
        display: none;
    }

    .req-mobile-summary {
        display: flex;
    }

    .req-page-shell .req-card--thread .rc-preview {
        display: none;
    }

    .req-page-shell .req-card--task .rc-preview {
        padding: 12px 13px;
    }

    .req-page-shell .rc-preview-label {
        margin-bottom: 5px;
        font-size: 0.66rem;
    }

    .req-page-shell .rc-preview-text,
    .req-page-shell .scad-nota {
        font-size: 0.86rem;
        line-height: 1.45;
    }

    .req-page-shell .rc-foot {
        gap: 8px;
    }

    .req-page-shell .rc-foot-scad {
        justify-content: flex-start;
    }

    .req-page-shell .chat-bubble {
        max-width: 100%;
        padding: 11px 12px;
    }

    .req-page-shell .chat-bubble-text {
        font-size: 0.86rem;
    }

    .req-page-shell .rc-expand-btn {
        min-height: 38px;
        font-size: 0.76rem;
    }

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

    .req-page-shell .rc-btn {
        width: 100%;
        min-height: 36px;
        height: auto;
        padding: 9px 10px;
        border-radius: 14px;
        font-size: 0.72rem;
        gap: 6px;
    }

    .req-page-shell .req-card .box-risposta {
        padding: 12px;
        border-radius: 16px;
    }

    .req-page-shell .req-card .reply-input {
        min-height: 74px;
        font-size: 0.86rem;
    }

    .req-page-shell .scad-date-badge {
        font-size: 0.72rem;
    }

    .req-page-shell .scad-fab-pick {
        justify-content: center;
    }

    .req-loading-card {
        padding: 24px 20px;
        min-height: 200px;
    }

    .req-loading-title {
        font-size: 1.35rem;
    }
}

/* ============================================================
   ACCOUNT DROPDOWN V2 — design premium
   Header con avatar + nome + email, sezioni con divisori sottili,
   icone monocrome allineate, sezione colore avatar collassabile.
   ============================================================ */
.account-dropdown-v2 {
    width: 320px !important;
    padding: 0 !important;
    background: var(--bg-surface, #ffffff) !important;
    border: 1px solid var(--border-color, rgba(0,0,0,0.08)) !important;
    border-radius: 18px !important;
    box-shadow: 0 22px 48px rgba(0,0,0,0.18), 0 6px 16px rgba(0,0,0,0.08) !important;
    overflow: hidden;
}
.account-dropdown-v2 .account-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    background: linear-gradient(180deg, var(--bg-surface, #fff) 0%, var(--bg-surface-soft, #faf9f7) 100%);
    border-bottom: 1px solid var(--border-color, rgba(0,0,0,0.06));
    margin: 0 !important;
}
.account-dropdown-v2 .account-ddrop-avatar {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.account-dropdown-v2 .account-ddrop-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.account-dropdown-v2 .account-ddrop-name {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-main, #111111);
    letter-spacing: -0.005em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.account-dropdown-v2 .account-ddrop-role {
    font-size: 12px;
    color: var(--text-muted, #78716c);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-dropdown-v2 .tenant-switcher-section {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color, rgba(0,0,0,0.06));
}
.account-dropdown-v2 .tenant-switcher-header {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted, #78716c);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.account-dropdown-v2 .tenant-switcher-select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--border-color, rgba(0,0,0,0.08));
    background: var(--bg-surface, #ffffff);
    color: var(--text-main, #111111);
    font-size: 13px;
    cursor: pointer;
}

.account-dropdown-v2 .account-menu-section {
    padding: 6px;
    border-bottom: 1px solid var(--border-color, rgba(0,0,0,0.06));
}
.account-dropdown-v2 .account-menu-section:last-child { border-bottom: none; }

.account-dropdown-v2 .account-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-main, #111111);
    font-size: 13.5px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.14s ease, color 0.14s ease;
}
.account-dropdown-v2 .account-menu-item:hover {
    background: var(--bg-surface-soft, rgba(0,0,0,0.04));
}
.account-dropdown-v2 .account-menu-item > i:first-child {
    width: 18px;
    font-size: 14px;
    color: var(--text-muted, #78716c);
    text-align: center;
    flex-shrink: 0;
}
.account-dropdown-v2 .account-menu-item:hover > i:first-child {
    color: var(--accent-color, #84cc16);
}
.account-dropdown-v2 .account-menu-label {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.account-dropdown-v2 .account-menu-logout {
    color: #dc2626;
}
.account-dropdown-v2 .account-menu-logout > i:first-child {
    color: #dc2626 !important;
}
.account-dropdown-v2 .account-menu-logout:hover {
    background: rgba(220,38,38,0.08);
}
.account-dropdown-v2 .badge-notif-menu {
    margin-left: auto;
    background: #dc2626;
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 99px;
}

/* Sezione collassabile "Colore avatar" */
.account-dropdown-v2 .account-menu-section-collapsible .avatar-color-section {
    display: none;
    padding: 6px 12px 10px;
}
.account-dropdown-v2 .account-menu-section-collapsible.is-open .avatar-color-section {
    display: block;
}
.account-dropdown-v2 .account-menu-chevron {
    margin-left: auto;
    font-size: 11px;
    transition: transform 0.2s ease;
    color: var(--text-muted, #9ca3af);
}
.account-dropdown-v2 .account-menu-section-collapsible.is-open .account-menu-chevron {
    transform: rotate(180deg);
}
.account-dropdown-v2 .avatar-color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}
.account-dropdown-v2 .avatar-color-add-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1.5px dashed var(--border-color, rgba(0,0,0,0.2));
    background: transparent;
    color: var(--text-muted, #78716c);
    font-size: 14px;
    cursor: pointer;
}

/* ============================================================
   MODAL IMPOSTAZIONI / CONSOLE — overlay full-screen premium
   ============================================================ */
.account-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99500;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 15, 17, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.22s ease;
}
.account-modal-overlay.is-open { opacity: 1; }

.account-modal {
    width: min(1240px, 96vw);
    height: min(880px, 92vh);
    max-height: 92dvh;
    background: var(--bg-body, #f5f4f2);
    border: 1px solid var(--border-color, rgba(0,0,0,0.08));
    border-radius: 22px;
    box-shadow: 0 40px 80px rgba(0,0,0,0.35), 0 12px 24px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.96) translateY(8px);
    transition: transform 0.28s cubic-bezier(0.22,1,0.36,1);
}
.account-modal-overlay.is-open .account-modal {
    transform: scale(1) translateY(0);
}

.account-modal-topbar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px;
    background: var(--bg-surface, #ffffff);
    border-bottom: 1px solid var(--border-color, rgba(0,0,0,0.06));
    min-height: 56px;
    box-sizing: border-box;
}
.account-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-main, #111111);
}
.account-modal-title i {
    color: var(--text-muted, #78716c);
    font-size: 14px;
}
.account-modal-close {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 10px;
    background: var(--bg-surface-soft, rgba(0,0,0,0.04));
    color: var(--text-muted, #78716c);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.14s ease, color 0.14s ease, transform 0.12s ease;
    flex-shrink: 0;
}
.account-modal-close:hover {
    background: rgba(220,38,38,0.10);
    color: #dc2626;
}
.account-modal-close:active { transform: scale(0.94); }

.account-modal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 14px 20px 18px;
}

/* Footer fisso del modal (azioni primarie) */
.account-modal-footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    background: var(--bg-surface, #ffffff);
    border-top: 1px solid var(--border-color, rgba(0,0,0,0.06));
    box-shadow: 0 -4px 18px rgba(0,0,0,0.04);
}
.account-modal-footer-hint {
    font-size: 12.5px;
    color: var(--text-muted, #78716c);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.account-modal-save-btn {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 12px;
    background: var(--accent-color, #84cc16);
    color: #0d0d0d;
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: -0.005em;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(132, 204, 22, 0.30),
                0 1px 2px rgba(0,0,0,0.06);
    transition: transform 0.14s cubic-bezier(0.22,1,0.36,1),
                box-shadow 0.18s ease, background 0.18s ease;
}
.account-modal-save-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(132, 204, 22, 0.42),
                0 2px 4px rgba(0,0,0,0.08);
}
.account-modal-save-btn:active { transform: scale(0.97); }
.account-modal-save-btn i { font-size: 12px; }

/* Responsive mobile: modal full-screen + safe-area iOS + touch target */
@media (max-width: 768px) {
    .account-modal-footer-hint { display: none; }
    .account-modal {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        max-height: none;
        border-radius: 0;
        border: none;
    }
    .account-modal-topbar {
        padding-top: calc(12px + var(--safe-top, 0px));
        min-height: calc(56px + var(--safe-top, 0px));
    }
    .account-modal-body {
        padding: 14px 14px 18px;
    }
    .account-modal-footer {
        padding: 12px 16px;
        padding-bottom: calc(12px + var(--safe-bottom, 0px));
    }
    .account-modal-save-btn {
        min-height: var(--touch-min, 44px);
        padding: 12px 22px;
        margin-left: auto;
        width: auto;
    }
    .account-modal-close {
        width: var(--touch-min, 44px);
        height: var(--touch-min, 44px);
    }
    .account-dropdown-v2 {
        width: calc(100vw - 24px) !important;
        max-width: 380px;
    }
    .account-dropdown-v2 .account-menu-item {
        min-height: var(--touch-min, 44px);
        padding: 12px 14px;
    }
}

