:root {
  --sfondo: #f4f6f9;
  --carta: #ffffff;
  --testo: #1f2733;
  --tenue: #667085;
  --bordo: #dfe3ea;
  --primario: #1d5fbf;
  --barra: #16365f;
  --evidenza: #fff6d6;
  --ok: #1e7a46;
  --attesa: #b26a00;
}
html, body { background: var(--sfondo); color: var(--testo); }
body { font-size: 15px; }
.contenitore { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.barra { background: var(--barra); color: #fff; }
.barra-dentro { display: flex; align-items: center; justify-content: space-between; min-height: 56px; gap: 12px; }
.marchio { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.marchio .sotto { opacity: .75; font-weight: 400; }
.logo { width: 32px; height: 32px; border-radius: 6px; background: #fff; display: block; object-fit: contain; }
.utente { display: flex; gap: 8px; min-width: 0; }
.btn-chiaro { color: #fff; border: 1px solid rgba(255,255,255,.45); max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-chiaro:hover { background: rgba(255,255,255,.12); color: #fff; }
main { padding-top: 20px; padding-bottom: 40px; }
h1 { font-size: 24px; font-weight: 700; }
.testo-tenue { color: var(--tenue); }
.piccolo { font-size: 13px; }

.scheda-accesso { max-width: 440px; margin: 24px auto; background: var(--carta); border: 1px solid var(--bordo); border-radius: 12px; padding: 28px; }
.regole { list-style: none; padding: 0; margin: 10px 0 14px; font-size: 14px; color: var(--tenue); }
.regole li::before { content: "○ "; }
.regole li.ok { color: var(--ok); }
.regole li.ok::before { content: "✓ "; }

.intestazione { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.riga-categoria { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.riga-categoria .etichetta { white-space: nowrap; }
.riga-categoria .form-select { max-width: 340px; font-weight: 600; min-width: 0; }
#oFornitore { max-width: 300px; }
.foto-vecchia { background: #fdecec; border: 1px solid #f1b5b5; color: #6b1414; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.attesa { background: var(--evidenza); border: 1px solid #f0d58a; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.schede { margin-bottom: 0; border-bottom-color: var(--bordo); flex-wrap: nowrap; overflow-x: auto; }
.schede .nav-link { white-space: nowrap; color: var(--tenue); }
.schede .nav-link.active { color: var(--testo); font-weight: 600; }
.pannello { background: var(--carta); border: 1px solid var(--bordo); border-radius: 10px; padding: 16px; margin-top: 14px; }
.pannello-titolo { font-weight: 600; margin-bottom: 10px; }
.opzioni { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; }
.gruppo { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.etichetta { color: var(--tenue); font-size: 14px; }
.cursore { min-width: 220px; }
.cursore .form-range { width: 200px; }
.interruttore { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.interruttore input { width: 18px; height: 18px; }

.aggiungi { position: relative; margin-bottom: 10px; }
.suggerimenti { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; background: var(--carta); border: 1px solid var(--bordo); border-radius: 8px; box-shadow: 0 8px 24px rgba(16,24,40,.12); max-height: 340px; overflow-y: auto; }
.sugg { display: grid; grid-template-columns: 70px 1fr auto; gap: 10px; padding: 8px 12px; cursor: pointer; border-bottom: 1px solid #f0f2f5; }
.sugg:last-child { border-bottom: 0; }
.sugg.attivo, .sugg:hover { background: #eef4ff; }
.sugg .cod { color: var(--tenue); }
.sugg .info { color: var(--tenue); font-size: 13px; white-space: nowrap; }
.etic { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 10px; background: #eef1f6; color: var(--tenue); margin-left: 6px; vertical-align: 1px; }
.etic.nuovo { background: #fdecec; color: #a32020; }

.tabella-scorre { overflow-x: auto; }
.table { margin-bottom: 0; }
.table th { font-weight: 600; color: var(--tenue); font-size: 13px; white-space: nowrap; }
.num { text-align: right; white-space: nowrap; }
.tabella-inv th[data-ord] { cursor: pointer; }
.tabella-inv th.ordinata::after { content: " ▾"; }
.tabella-inv th.ordinata.su::after { content: " ▴"; }
.desc { min-width: 200px; }
.cod-telefono { display: none; }
.qta { display: inline-flex; align-items: center; gap: 4px; }
.qta input { width: 64px; text-align: right; }
.qta .btn { padding: 0 8px; line-height: 1.6; }
.sotto-qta { font-size: 12px; color: var(--tenue); }
.riga-nuova { background: var(--evidenza); }
.btn-icona { border: 0; background: none; padding: 2px 6px; color: var(--tenue); font-weight: 700; }
.btn-icona:hover { color: var(--primario); }
.totali { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--bordo); }
.totali b { font-variant-numeric: tabular-nums; }
.azioni { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.vuoto { background: var(--carta); border: 1px dashed var(--bordo); border-radius: 10px; padding: 22px; margin-top: 14px; }
.vuoto h2 { font-size: 18px; }
.vuoto-piccolo { color: var(--tenue); padding: 18px 4px; }
.nota-ordine { background: #eef4ff; border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; font-size: 14px; }
.filtri { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.filtri .form-control { max-width: 320px; }
.filtri .form-select { max-width: 260px; }

.ordine-salvato { border: 1px solid var(--bordo); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.ordine-salvato .testa { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.stato { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; }
.stato.attesa { background: #fff1d6; color: var(--attesa); }
.stato.importazione { background: #e5efff; color: var(--primario); }
.stato.importato { background: #e3f4ea; color: var(--ok); }
.stato.annullato { background: #eef0f3; color: var(--tenue); }
.ordine-salvato .azioni { margin-top: 8px; }
.passi li { margin-bottom: 6px; }
.passi li:last-child { font-weight: 700; }
.passi-logista li { margin-bottom: 8px; }

@media (max-width: 640px) {
  h1 { font-size: 20px; }
  .scheda-accesso { padding: 20px; margin: 8px auto; }
  .marchio .sotto { display: none; }
  .cursore .form-range { width: 160px; }
  .tabella-ordine th:nth-child(1), .tabella-ordine td:nth-child(1),
  .tabella-ordine th:nth-child(3), .tabella-ordine td:nth-child(3),
  .tabella-ordine th:nth-child(4), .tabella-ordine td:nth-child(4),
  .tabella-ordine th:nth-child(6), .tabella-ordine td:nth-child(6) { display: none; }
  .tabella-ordine .desc { min-width: 0; font-size: 14px; }
  .cod-telefono { display: inline; color: var(--tenue); }
  .qta input { width: 48px; }
}
