.badge { padding: 2px 8px; border-radius: 999px; font-size: 12px; background: #e2e8f0; }
.badge.pagata { background: #bbf7d0; }
.badge.emessa { background: #bae6fd; }
.badge.scaduta { background: #fecaca; }
.badge.bozza { background: #e5e7eb; }
.badge.ok { background: #bbf7d0; color: #166534; }
.badge.ko { background: #fecaca; color: #991b1b; }

/* Modal invio asincrono */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 9999; align-items: center; justify-content: center; }
.modal[aria-hidden="false"] { display: flex; }
.modal-card { background: white; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); max-width: 600px; width: 90%; overflow: hidden; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid #e5e7eb; }
.modal-header h3 { margin: 0; font-size: 18px; }
.icon-btn { background: none; border: none; cursor: pointer; font-size: 24px; color: #6b7280; padding: 0; }
.icon-btn:hover { color: #1f2937; }

.fatture-create-header { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.fattura-modal-card { max-width: 980px; width: min(980px, 100%); }
.fattura-modal-section { border:1px solid #e5e7eb; border-radius:10px; padding:12px; margin-top:12px; }
.fattura-modal-grid { grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:12px; }
.fattura-modal-actions { display:flex; gap:10px; justify-content:flex-end; margin-top:14px; flex-wrap:wrap; }

@media (max-width: 768px) {
    .fattura-modal-actions .btn { flex:1 1 100%; }
}
