/* ui retail · pannello cloud (retail.u-i.app) — palette Mandarino, Manrope, carte bianche, pillole */
@font-face { font-family: "Manrope"; font-weight: 200 800; font-display: swap; src: url("../fonts/manrope-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Manrope"; font-weight: 200 800; font-display: swap; src: url("../fonts/manrope-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --b: #d4541a; --bd: #a5400f; --bt: #fdebe1;
  --ink: #1f1a17; --ink2: #4d4640; --mut: #716a64; --mut2: #aca49c;
  --bg: #f7f5f2; --card: #ffffff; --ln: #e8e3dd; --ln2: #f1ede8; --chip: #efeae5;
  --soft: #f3efeb; --soft2: #ebe6e0; --soft3: #f8f6f3;
  --pe: #fff0de; --pet: #8a3a0c; --lo: #9a5b00; --lot: #fcefd8; --ze: #a8321f; --zet: #fbe4df;
  --ok: #2f6b3f; --okt: #e5f1e7;
  --glow: rgba(212, 84, 26, .30);
  --ombra: 0 2px 12px rgba(29, 26, 33, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "Manrope", system-ui, sans-serif; color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.4; font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--bd); }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; }
.nascosto { display: none !important; }

/* barra in alto */
.nav { height: 68px; display: flex; align-items: center; gap: 10px; padding: 0 20px; position: sticky; top: 0; background: var(--bg); z-index: 5; }
.nav .marchio { height: 30px; display: block; }
.nav .marchio img { height: 30px; width: auto; display: block; }
.tabs { display: flex; gap: 4px; margin-left: 8px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--ink2); text-decoration: none; white-space: nowrap; }
.tabs a.on { background: var(--ink); color: #fff; }
.tabs a:hover:not(.on) { background: var(--soft2); }
.nav .destra { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.op { display: flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 700; white-space: nowrap; background: none; border: 0; cursor: pointer; }
.op i { width: 34px; height: 34px; border-radius: 50%; background: var(--bt); display: grid; place-items: center; font-style: normal; font-size: 12px; color: var(--bd); font-weight: 800; }

.pagina { padding: 4px 20px 40px; max-width: 1400px; margin: 0 auto; display: grid; gap: 14px; }
.ttl { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.ttl h1 { font-size: 24px; font-weight: 800; }
.ttl .id { font-size: 12px; color: var(--mut); font-weight: 600; }
.ttl .azioni { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* componenti */
.card { background: var(--card); border-radius: 18px; box-shadow: var(--ombra); }
.box { padding: 14px 16px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.box h2 { font-size: 14px; font-weight: 800; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.box h2 small { font-weight: 600; color: var(--mut); font-size: 11.5px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.kpi { padding: 12px 16px; display: grid; gap: 2px; }
.kpi small { font-size: 11px; font-weight: 800; color: var(--mut); text-transform: uppercase; letter-spacing: .06em; }
.kpi b { font-size: 26px; font-weight: 800; line-height: 1.1; }
.kpi span { font-size: 12px; color: var(--mut); font-weight: 600; }
.kpi.warn { background: var(--pe); }
.kpi.warn small, .kpi.warn b, .kpi.warn span { color: var(--pet); }
.colonne { display: grid; grid-template-columns: 1fr 340px; gap: 12px; align-items: start; }
.due { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }

.btn { height: 38px; padding: 0 16px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; font-weight: 700; background: var(--chip); color: var(--ink2); white-space: nowrap; border: 0; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--soft2); }
.btn.p { background: var(--b); color: #fff; box-shadow: 0 6px 16px var(--glow); }
.btn.p:hover { background: var(--bd); }
.btn.piccolo { height: 30px; padding: 0 12px; font-size: 12px; }
.btn.rischio { background: var(--zet); color: var(--ze); }
.btn:disabled { background: var(--soft2); color: var(--mut2); box-shadow: none; cursor: default; }
.chip { height: 34px; padding: 0 14px; border-radius: 999px; background: var(--chip); display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink2); white-space: nowrap; border: 0; }
select.chip { padding-right: 8px; cursor: pointer; }
.seg { display: inline-flex; gap: 4px; background: var(--soft2); padding: 4px; border-radius: 999px; }
.seg button { padding: 6px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: var(--ink2); border: 0; background: none; cursor: pointer; }
.seg button.on { background: #fff; color: var(--bd); box-shadow: 0 1px 3px rgba(29, 26, 33, .08); }
.st { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; display: inline-flex; gap: 6px; align-items: center; background: var(--chip); color: var(--ink2); white-space: nowrap; }
.st.on, .st.ok { background: var(--okt); color: var(--ok); }
.st.attesa { background: var(--lot); color: var(--lo); }
.st.off, .st.ko { background: var(--zet); color: var(--ze); }
.st.b { background: var(--bt); color: var(--bd); }
.vuoto { color: var(--mut); font-size: 13px; padding: 18px 4px; text-align: center; }
.nota { font-size: 12px; color: var(--mut); }
.avviso { background: var(--pe); color: var(--pet); padding: 10px 14px; border-radius: 14px; font-size: 13px; font-weight: 600; }
.chiave { font-family: ui-monospace, Menlo, monospace; background: var(--soft3); border: 1px dashed var(--ln); padding: 10px 12px; border-radius: 12px; word-break: break-all; font-size: 13px; }

/* tabelle */
.tab { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--mut); font-weight: 700; padding: 6px 8px; border-bottom: 1px solid var(--ln); white-space: nowrap; }
td { padding: 9px 8px; border-bottom: 1px solid var(--ln2); vertical-align: top; }
td.r, th.r { text-align: right; white-space: nowrap; }
td .sub { display: block; font-size: 11px; color: var(--mut2); font-weight: 600; }
tr.cliccabile { cursor: pointer; }
tr.cliccabile:hover td { background: var(--soft3); }
tr.tot td { font-weight: 800; border-bottom: 0; background: var(--soft3); }

/* moduli */
.campi { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 12px; }
.campo { display: grid; gap: 4px; font-size: 12px; font-weight: 700; color: var(--mut); }
.campo.largo { grid-column: 1 / -1; }
input, select, textarea { height: 40px; border-radius: 12px; border: 1px solid var(--ln); background: #fff; padding: 0 12px; font-size: 14px; font-weight: 600; color: var(--ink); min-width: 0; width: 100%; }
textarea { height: auto; min-height: 70px; padding: 10px 12px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--b); outline-offset: 0; border-color: transparent; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--b); }
.spunta { display: flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 600; color: var(--ink2); }
.cerca { height: 44px; border-radius: 999px; background: var(--card); display: flex; align-items: center; gap: 10px; padding: 0 18px; box-shadow: var(--ombra); min-width: 240px; flex: 1; }
.cerca input { border: 0; height: 40px; padding: 0; outline: none; }
.cerca svg { width: 18px; height: 18px; color: var(--bd); flex: none; }
.righe-modifica { display: grid; gap: 6px; }
.riga-modifica { display: grid; gap: 6px; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)) 34px; align-items: end; background: var(--soft3); border-radius: 12px; padding: 8px; }
.riga-modifica .btn { height: 34px; padding: 0; }

/* finestra */
.velo { position: fixed; inset: 0; background: rgba(31, 26, 23, .35); display: grid; place-items: center; z-index: 20; padding: 16px; }
.finestra { width: min(860px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 18px 20px; display: grid; gap: 14px; }
.finestra .testa { display: flex; align-items: center; gap: 10px; }
.finestra .testa h2 { font-size: 18px; font-weight: 800; }
.finestra .testa .x { margin-left: auto; }
.finestra .piede { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

.messaggio { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 13px; z-index: 30; box-shadow: 0 10px 24px rgba(0, 0, 0, .2); }
.messaggio.ko { background: var(--ze); }

/* grafico a barre */
.barre { display: flex; gap: 4px; align-items: flex-end; height: 160px; padding-top: 8px; }
.barre .bc { flex: 1; display: grid; gap: 4px; justify-items: center; min-width: 0; }
.barre .bc i { display: block; width: 100%; max-width: 34px; background: var(--b); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.barre .bc small { font-size: 10px; color: var(--mut); font-weight: 700; }
.lista-barre { display: grid; gap: 8px; }
.lista-barre div { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 12.5px; font-weight: 700; }
.lista-barre div i { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: var(--soft2); overflow: hidden; }
.lista-barre div i b { display: block; height: 100%; background: var(--b); border-radius: 999px; }

/* accesso */
.accesso { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.accesso .card { width: min(400px, 100%); padding: 28px 26px; display: grid; gap: 14px; }
.accesso img { height: 40px; justify-self: start; }
.accesso h1 { font-size: 20px; font-weight: 800; }

@media (max-width: 980px) {
  .colonne, .due { grid-template-columns: 1fr; }
  .nav { flex-wrap: wrap; height: auto; padding: 10px 16px; }
  .tabs { order: 3; width: 100%; margin-left: 0; }
  .pagina { padding: 4px 16px 32px; }
}

/* ---- clienti (staff) */
.sez { font-size: 13px; font-weight: 800; margin: 16px 0 8px; display: flex; gap: 8px; align-items: baseline; }
.sez small { font-weight: 600; color: var(--mut); font-size: 11.5px; }
td .pieno { color: var(--ze); font-weight: 800; }
ul.nota, ol.nota { margin: 0 0 12px; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; }
.codice-inst { font: 800 30px/1.2 ui-monospace, Menlo, monospace; letter-spacing: .08em; text-align: center; background: var(--bt); color: var(--bd); padding: 16px; border-radius: 16px; margin-bottom: 10px; }
.box .azioni { margin-top: 12px; }
.ttl h1 .st { vertical-align: middle; font-size: 12px; }
