/*body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 0;
    padding: 20px;
    background: #0f172a;
    color: #e5e7eb;
}

h1 {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.card {
    background: #111827;
    border-radius: 12px;
    padding: 16px;
    max-width: 1400px;
    margin: 0 auto 24px auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

button {
    padding: 8px 16px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    margin-right: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

button.primary {
    background: #22c55e;
    color: #022c22;
    font-weight: 600;
}

button.primary:hover {
    background: #16a34a;
}

button.primary.recording {
    background: #ef4444;
    color: #fff;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

button.secondary {
    background: #1f2937;
    color: #e5e7eb;
}

button.secondary:hover {
    background: #374151;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.status {
    margin-top: 12px;
    font-size: 0.9rem;
    color: #9ca3af;
}

audio {
    width: 100%;
    margin-top: 10px;
}

pre {
    background: #020617;
    border-radius: 8px;
    padding: 12px;
    font-size: 0.85rem;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    background: #1f2937;
    color: #a5b4fc;
    margin-left: 8px;
}

.badge.success {
    background: #166534;
    color: #86efac;
}

.badge.warning {
    background: #854d0e;
    color: #fde047;
}

.badge.error {
    background: #991b1b;
    color: #fca5a5;
}

table.dataTable {
    color: #e5e7eb !important;
}

table.dataTable thead th {
    background: #1f2937;
    color: #e5e7eb;
    border-bottom: 2px solid #374151;
}

table.dataTable tbody td {
    border-bottom: 1px solid #374151;
    padding: 10px;
}

table.dataTable tbody tr:hover {
    background: #1f2937 !important;
}

.editable-cell {
    cursor: pointer;
    position: relative;
    min-height: 20px;
}

.editable-cell:hover::after {
    content: "✏️ Doppio click per modificare";
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: #60a5fa;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
    pointer-events: none;
    z-index: 1000;
}

.cell-input {
    width: 100%;
    background: #1e3a8a;
    border: 2px solid #3b82f6;
    color: #e5e7eb;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
}

.cell-input:focus {
    outline: none;
    border-color: #60a5fa;
}

.product-cell {
    position: relative;
}

.product-name {
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

.product-original {
    font-size: 0.8rem;
    color: #9ca3af;
    font-style: italic;
}

.product-id {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 2px;
}

.confidence-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 4px;
}

.confidence-high {
    background: #166534;
    color: #86efac;
}

.confidence-medium {
    background: #854d0e;
    color: #fde047;
}

.confidence-low {
    background: #991b1b;
    color: #fca5a5;
}

.no-match {
    color: #ef4444;
}

.action-btn {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 6px 10px;
    margin: 0 2px;
    border-radius: 4px;
    font-size: 1.1rem;
    transition: all 0.2s;
}

.action-btn:hover {
    transform: scale(1.1);
}

.action-btn.delete:hover {
    color: #f87171;
    background: #7f1d1d;
}

.info-box {
    background: #1f2937;
    border-left: 4px solid #3b82f6;
    padding: 12px;
    margin: 12px 0;
    border-radius: 4px;
}

.info-box h3 {
    margin: 0 0 8px 0;
    font-size: 1rem;
    color: #60a5fa;
}

.info-box p {
    margin: 4px 0;
    font-size: 0.9rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.stat-card {
    background: #1f2937;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #60a5fa;
}

.stat-label {
    font-size: 0.85rem;
    color: #9ca3af;
    margin-top: 4px;
}

.json-container {
    margin-top: 12px;
}

.json-toggle {
    margin-bottom: 8px;
}

#rawJsonSection {
    display: none;
}

#rawJsonSection.visible {
    display: block;
}
.rec_button {
    padding: 30px;
    font-size: 24px;
    ;
} */



/* ========== ICONE ORDINAMENTO DATATABLES 2.x ========== */

/* Nascondi icone default */
.dt-column-order::before,
.dt-column-order::after {
    display: none !important;
}

/* Setup del wrapper dt-column-header con flexbox */
.dt-column-header {
    display: flex !important;
    align-items: center;
    gap: 8px;
}

/* ========== ORDINE ELEMENTI (SEMPRE!) ========== */
.dt-column-title {
    order: 1 !important;
    flex-grow: 1;
}

.dt-column-order {
    order: 2 !important;
    flex-shrink: 0;
    margin-left: 8px;
}
/* ================================================ */

.dt-column-order i {
    font-size: 0.875rem;
    transition: transform 0.2s ease;
}

/* ========== ALLINEAMENTI ========== */

/* Sinistra (default) */
th.text-start .dt-column-header,
th:not(.text-end):not(.text-center) .dt-column-header {
    justify-content: flex-start;
    flex-direction: row !important;
}

/* Destra */
th.text-end .dt-column-header {
    justify-content: flex-end;
    flex-direction: row !important; /* ← CRITICO per colonne numeriche */
}

/* Centro */
th.text-center .dt-column-header {
    justify-content: center;
    flex-direction: row !important;
}

/* ========== FIX SPECIFICO PER COLONNE NUMERICHE ========== */

/* Forza ordine corretto anche per dt-type-numeric */
th.dt-type-numeric .dt-column-header {
    flex-direction: row !important; /* NON row-reverse */
}

th.dt-type-numeric.text-end .dt-column-header {
    justify-content: flex-end;
    flex-direction: row !important;
}

th.dt-type-numeric .dt-column-title {
    order: 1 !important;
}

th.dt-type-numeric .dt-column-order {
    order: 2 !important;
    margin-left: 8px;
    margin-right: 0;
}

/* ========================================================= */

/* ========== COLONNE NON ORDINABILI ========== */
th.dt-orderable-none .dt-column-order {
    display: none !important;
}

/* ========== HOVER E INTERAZIONI ========== */
th:not(.dt-orderable-none):hover .dt-column-order i {
    transform: scale(1.15);
}

th:not(.dt-orderable-none):active .dt-column-order i {
    transform: scale(0.9);
}

/* ========== COLORI TEMA ========== */

/* Light mode */
[data-bs-theme="light"] th.dt-ordering-asc .dt-column-order i,
[data-bs-theme="light"] th.dt-ordering-desc .dt-column-order i {
    color: #0d6efd !important;
}

/* Dark mode */
[data-bs-theme="dark"] th.dt-ordering-asc .dt-column-order i,
[data-bs-theme="dark"] th.dt-ordering-desc .dt-column-order i {
    color: #86b7fe !important;
}

/* ====================================================== */