/* MADA Strumenti · calcolatore, check-up e anteprima di Insight nei colori MADA.
   Ogni strumento è un "container": si adatta alla larghezza della colonna, sul sito come nell'anteprima.
   Le regole con !important annullano gli stili di Flatsome su campi, pulsanti, etichette ed elenchi. */
.mada-st { --st-y: #E7C43F; --st-k: #111111; --st-line: #e3e1d9; --st-chiaro: #F4F3EF; --st-ok: #2E7D4F; --st-ko: #B3261E; --st-sans: "DM Sans", "Helvetica Neue", Arial, sans-serif; --st-head: "Archivo", "Helvetica Neue", Arial, sans-serif; container-type: inline-size; font-family: var(--st-sans); color: var(--st-k); }
.mada-st *, .mada-st *::before, .mada-st *::after { box-sizing: border-box; }
.mada-st [hidden][hidden] { display: none !important; }
.mada-st p { margin: 0; }
.mada-st ul, .mada-st ol { list-style: none !important; margin: 0; padding: 0; }
.mada-st li { margin: 0 !important; list-style: none !important; }
.mada-st li::before, .mada-st li::marker { content: none; }
.mada-st .mada-st-kicker { margin: 0 0 14px !important; font-size: .75rem !important; font-weight: 700; line-height: 1.4 !important; letter-spacing: .14em; text-transform: uppercase; color: #6b6b6b !important; }
.mada-st .mada-st-nota { margin: 14px 0 0 !important; font-size: .85rem !important; line-height: 1.45 !important; color: #6b6b6b !important; }

/* Pulsanti */
.mada-st .mada-st-btn { display: inline-flex !important; align-items: center; justify-content: center; min-height: 48px !important; height: auto !important; margin: 0 !important; padding: 0 24px !important; border: 2px solid var(--st-y) !important; border-radius: 99px !important; background: var(--st-y) !important; color: var(--st-k) !important; font: 700 1rem/1.2 var(--st-sans) !important; letter-spacing: 0 !important; text-transform: none !important; text-decoration: none !important; text-align: center; cursor: pointer; box-shadow: none !important; }
.mada-st .mada-st-btn:hover { background: #F0D35C !important; border-color: #F0D35C !important; }
.mada-st .mada-st-btn-ghost { background: transparent !important; border-color: var(--st-k) !important; }
.mada-st .mada-st-btn-ghost:hover { background: var(--st-k) !important; border-color: var(--st-k) !important; color: #ffffff !important; }
.mada-st .mada-st-btn:disabled { opacity: .4; cursor: not-allowed; }
.mada-st .mada-st-btn:disabled:hover { background: var(--st-y) !important; border-color: var(--st-y) !important; }
.mada-st button:focus-visible, .mada-st a:focus-visible, .mada-st input:focus-visible, .mada-st select:focus-visible, .mada-st .mada-cu-scelte input:focus-visible + span { outline: 3px solid var(--st-y) !important; outline-offset: 2px; }

/* Campi */
.mada-st label { display: flex !important; flex-direction: column; gap: 6px; margin: 0 !important; font-family: var(--st-sans) !important; font-size: .85rem !important; font-weight: 700 !important; line-height: 1.3 !important; letter-spacing: 0 !important; text-transform: none !important; color: var(--st-k) !important; }
.mada-st input[type="text"], .mada-st input[type="number"], .mada-st select { width: 100% !important; max-width: none; height: 46px !important; min-height: 0 !important; margin: 0 !important; padding: 0 12px !important; border: 1px solid #cfccc3 !important; border-radius: 12px !important; background-color: #ffffff !important; box-shadow: none !important; font: 500 1rem/1.2 var(--st-sans) !important; color: var(--st-k) !important; }
.mada-st input[type="text"]:focus, .mada-st input[type="number"]:focus, .mada-st select:focus { border-color: var(--st-k) !important; }
.mada-st select { padding-right: 36px !important; } /* spazio per la freccia del tema */
.mada-st small { display: block; font-size: .8rem; font-weight: 500; line-height: 1.4; color: #6b6b6b; }

/* ---------- Calcolatore ---------- */
.mada-st .mada-calc-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); overflow: hidden; border: 1px solid var(--st-line); border-radius: 26px; background: #ffffff; }
.mada-st .mada-calc-input { padding: 30px 30px 28px; }
.mada-st .mada-calc-righe { display: grid; gap: 12px; margin: 0 0 14px; }
.mada-st .mada-calc-riga { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 16px 16px 12px !important; border: 1px solid var(--st-line); border-radius: 18px; background: var(--st-chiaro); }
.mada-st .mada-calc-nome { grid-column: 1 / -1; padding-right: 40px; }
.mada-st .mada-calc-riga-ore { grid-column: 1 / -1; font-size: .85rem !important; font-weight: 700; line-height: 1.3 !important; color: #6b6b6b !important; }
.mada-st .mada-calc-togli { position: absolute; top: 10px; right: 10px; display: flex !important; align-items: center; justify-content: center; width: 34px; height: 34px !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 50% !important; background: transparent !important; color: #6b6b6b !important; font: 400 1.5rem/1 var(--st-sans) !important; cursor: pointer; box-shadow: none !important; }
.mada-st .mada-calc-togli:hover { background: #e7e5de !important; color: var(--st-k) !important; }
.mada-st .mada-calc-aggiungi { display: inline-flex !important; align-items: center; min-height: 44px !important; height: auto !important; margin: 0 !important; padding: 0 18px !important; border: 1.5px dashed #8a877f !important; border-radius: 99px !important; background: transparent !important; color: var(--st-k) !important; font: 700 .95rem/1.2 var(--st-sans) !important; letter-spacing: 0 !important; text-transform: none !important; cursor: pointer; box-shadow: none !important; }
.mada-st .mada-calc-aggiungi:hover { border-color: var(--st-k) !important; border-style: solid !important; }
.mada-st .mada-calc-impostazioni { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px 24px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--st-line); }
.mada-st .mada-calc-euro { display: flex; align-items: center; gap: 8px; font-size: 1rem; }
.mada-st .mada-calc-euro input { max-width: 130px; }
.mada-st output { font-family: var(--st-head); font-weight: 800; color: var(--st-k); }
.mada-st input[type="range"] { width: 100%; height: 28px; margin: 4px 0 0; padding: 0; border: 0; background: transparent; box-shadow: none; accent-color: var(--st-k); }

.mada-st .mada-calc-esito { padding: 30px 30px 28px; background: var(--st-k); color: #ffffff; }
.mada-st .mada-calc-esito-in { position: sticky; top: 110px; display: flex; flex-direction: column; }
.mada-st .mada-calc-esito .mada-st-kicker { color: var(--st-y) !important; }
.mada-st .mada-calc-grande { display: flex; flex-direction: column; margin: 0 0 22px !important; font-family: var(--st-head) !important; font-size: 4.6rem !important; font-weight: 900; line-height: .9 !important; letter-spacing: -0.04em; color: var(--st-y) !important; }
.mada-st .mada-calc-grande small { margin-top: 10px; font-family: var(--st-sans); font-size: 1.05rem; font-weight: 700; letter-spacing: 0; line-height: 1.3; color: #ffffff; }
/* Flatsome mette dt e dd in linea, in maiuscolo e un po' trasparenti: qui tornano normali */
.mada-st .mada-calc-numeri { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin: 0 0 14px !important; font-size: 1rem !important; opacity: 1 !important; text-transform: none !important; letter-spacing: 0 !important; }
.mada-st .mada-calc-numeri div { padding: 14px 16px; border: 1px solid #2e2e2e; border-radius: 16px; }
.mada-st .mada-calc-numeri dt { display: block !important; float: none !important; margin: 0 0 4px !important; font-size: .8rem; font-weight: 500; text-transform: none !important; color: #bdbdbd; }
.mada-st .mada-calc-numeri dd { display: block !important; float: none !important; margin: 0 !important; font-family: var(--st-head); font-size: 1.5rem; font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; color: #ffffff; }
.mada-st .mada-calc-risparmio { margin: 0 0 22px; padding: 16px 18px; border-radius: 16px; background: #1e1e1e; }
.mada-st .mada-calc-risparmio p { font-size: .95rem !important; line-height: 1.45 !important; color: #d8d8d8 !important; }
.mada-st .mada-calc-risparmio b { color: var(--st-y); }
.mada-st .mada-calc-risparmio .mada-calc-rec { margin-top: 4px; font-family: var(--st-head) !important; font-size: 1.35rem !important; font-weight: 800; line-height: 1.2 !important; color: #ffffff !important; }
.mada-st .mada-calc-esito .mada-st-btn { align-self: stretch; }
.mada-st .mada-calc-esito .mada-st-nota { color: #9a9a9a !important; }

@container (max-width: 820px) {
  .mada-st .mada-calc-grid { grid-template-columns: minmax(0, 1fr); }
  .mada-st .mada-calc-esito-in { position: static; }
}
@container (max-width: 520px) {
  .mada-st .mada-calc-input, .mada-st .mada-calc-esito { padding: 22px 18px; }
  .mada-st .mada-calc-riga { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mada-st .mada-calc-impostazioni { grid-template-columns: minmax(0, 1fr); }
  .mada-st .mada-calc-grande { font-size: 3.6rem !important; }
}

/* ---------- Check-up ---------- */
.mada-st.mada-cu { overflow: hidden; border: 1px solid var(--st-line); border-radius: 26px; background: #ffffff; }
.mada-st .mada-cu-testa { padding: 22px 30px 0; }
.mada-st .mada-cu-passi { display: flex; gap: 6px; margin: 0 0 14px; overflow-x: auto; scrollbar-width: none; }
.mada-st .mada-cu-passi li { flex: none; padding: 6px 12px; border-radius: 99px; background: var(--st-chiaro); font-size: .8rem; font-weight: 700; line-height: 1.3; color: #6b6b6b; }
.mada-st .mada-cu-passi li.fatto { background: var(--st-k); color: #ffffff; }
.mada-st .mada-cu-passi li[aria-current="step"] { background: var(--st-y); color: var(--st-k); }
.mada-st .mada-cu-barra { height: 6px; overflow: hidden; border-radius: 99px; background: #ece9e1; }
.mada-st .mada-cu-barra span { display: block; width: 0; height: 100%; border-radius: 99px; background: var(--st-k); transition: width .3s ease; }
.mada-st .mada-cu-form { margin: 0; }
.mada-st .mada-cu-area { min-width: 0; margin: 0 !important; padding: 26px 30px 28px !important; border: 0 !important; }
.mada-st .mada-cu-area legend { display: block; float: left; width: 100%; margin: 0 0 14px !important; padding: 0 !important; border: 0 !important; font-family: var(--st-head) !important; font-size: 1.6rem !important; font-weight: 800 !important; line-height: 1.15 !important; letter-spacing: -0.015em; text-transform: none !important; color: var(--st-k) !important; }
.mada-st .mada-cu-area legend:focus { outline: none; }
.mada-st .mada-cu-area legend span { display: block; margin-bottom: 4px; font-family: var(--st-sans); font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #6b6b6b; }
.mada-st .mada-cu-q { clear: both; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 24px; padding: 16px 0; border-top: 1px solid var(--st-line); }
.mada-st .mada-cu-testo { font-size: 1.02rem !important; line-height: 1.45 !important; color: var(--st-k) !important; }
.mada-st .mada-cu-scelte { display: flex; flex-wrap: wrap; gap: 6px; }
.mada-st .mada-cu-scelte label { position: relative; display: inline-flex !important; flex-direction: row; font-weight: 600 !important; }
.mada-st .mada-cu-scelte input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.mada-st .mada-cu-scelte span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border: 1.5px solid #bdb9ae; border-radius: 99px; background: #ffffff; font-size: .92rem; white-space: nowrap; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.mada-st .mada-cu-scelte span:hover { border-color: var(--st-k); }
.mada-st .mada-cu-scelte input:checked + span { border-color: var(--st-k); background: var(--st-k); color: #ffffff; }
.mada-st .mada-cu-nav { clear: both; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding-top: 20px; border-top: 1px solid var(--st-line); }
.mada-st .mada-cu-mancano { font-size: .85rem; color: #6b6b6b; }

.mada-st .mada-cu-esito { padding: 28px 30px 30px; }
.mada-st .mada-cu-titolo { margin: 0 0 6px !important; font-family: var(--st-head) !important; font-size: 1.8rem !important; font-weight: 800 !important; line-height: 1.15 !important; letter-spacing: -0.02em; color: var(--st-k) !important; }
.mada-st .mada-cu-titolo:focus { outline: none; }
.mada-st .mada-cu-sotto { font-size: 1.02rem !important; color: #3a3a3a !important; }
.mada-st .mada-cu-aree { display: grid; gap: 12px; margin: 22px 0 30px; }
.mada-st .mada-cu-aree li { display: grid; grid-template-columns: 14em minmax(0, 1fr) 10em; align-items: center; gap: 14px; }
.mada-st .mada-cu-aree .nome { font-weight: 700; }
.mada-st .mada-cu-aree .bar { display: block; height: 10px; overflow: hidden; border-radius: 99px; background: #ece9e1; }
.mada-st .mada-cu-aree .bar i { display: block; height: 10px; border-radius: 99px; }
.mada-st .mada-cu-aree .stato { display: inline-flex; align-items: center; gap: 7px; font-size: .88rem; font-weight: 700; }
.mada-st .mada-cu-aree .stato::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.mada-st .mada-cu-aree .ok .bar i { background: var(--st-ok); }
.mada-st .mada-cu-aree .ok .stato { color: var(--st-ok); }
.mada-st .mada-cu-aree .medio .bar i { background: var(--st-y); }
.mada-st .mada-cu-aree .medio .stato { color: #7a6000; }
.mada-st .mada-cu-aree .ko .bar i { background: var(--st-ko); }
.mada-st .mada-cu-aree .ko .stato { color: var(--st-ko); }
.mada-st .mada-cu-prio { display: grid; gap: 12px; margin: 0 0 26px; counter-reset: prio; }
.mada-st .mada-cu-prio li { position: relative; padding: 16px 18px 16px 64px; border-radius: 18px; background: var(--st-chiaro); counter-increment: prio; }
.mada-st .mada-cu-prio li::before { content: counter(prio); position: absolute; top: 16px; left: 18px; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--st-k); color: var(--st-y); font: 800 1rem/1 var(--st-head); }
.mada-st .mada-cu-prio strong { display: block; margin-bottom: 4px; font-family: var(--st-head); font-size: 1.08rem; font-weight: 800; color: var(--st-k); }
.mada-st .mada-cu-prio p { font-size: .95rem !important; line-height: 1.5 !important; color: #3a3a3a !important; }
.mada-st .mada-cu-prio small { display: inline; margin-left: 4px; }
.mada-st .mada-cu-prio a { display: inline-block; margin-top: 6px; font-weight: 700; color: var(--st-k); text-decoration: underline; text-decoration-color: var(--st-y); text-decoration-thickness: 3px; text-underline-offset: 3px; }
.mada-st .mada-cu-azioni { display: flex; flex-wrap: wrap; gap: 10px; }

@container (max-width: 680px) {
  .mada-st .mada-cu-testa { padding: 18px 18px 0; }
  .mada-st .mada-cu-area { padding: 22px 18px 24px !important; }
  .mada-st .mada-cu-q { grid-template-columns: minmax(0, 1fr); }
  .mada-st .mada-cu-esito { padding: 22px 18px 24px; }
  .mada-st .mada-cu-aree li { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  .mada-st .mada-cu-aree .bar { grid-column: 1 / -1; grid-row: 2; }
  .mada-st .mada-cu-prio li { padding-left: 58px; }
  .mada-st .mada-cu-azioni .mada-st-btn { width: 100%; }
}

/* Stampa del report: in stampa si vede solo la copia del risultato messa in fondo alla pagina */
.mada-cu-report { display: none; }
@media print {
  body.mada-cu-stampa > * { display: none !important; }
  body.mada-cu-stampa > .mada-cu-report { display: block !important; margin: 0; padding: 0; }
  .mada-cu-report, .mada-cu-report * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .mada-st .mada-cu-report-testa { margin: 0 0 18px; padding-bottom: 10px; border-bottom: 2px solid var(--st-y); font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #6b6b6b; }
  .mada-cu-report .mada-cu-esito { padding: 0 !important; }
  .mada-cu-report .mada-cu-azioni { display: none !important; }
  .mada-cu-report .mada-cu-prio li, .mada-cu-report .mada-cu-aree li { break-inside: avoid; }
}

/* ---------- MADA Insight (anteprima con dati di esempio) ---------- */
.mada-st .mada-in-grid { display: block; }
.mada-st .mada-in-piede { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 28px; margin-top: 22px; }
.mada-st .mada-in-piede .mada-st-nota { flex: 1 1 22em; margin: 0 !important; color: #9a9a9a !important; }
.mada-st .mada-in-app { overflow: hidden; border: 1px solid #2a2a2a; border-radius: 20px; background: #f7f6f2; box-shadow: 0 30px 80px rgba(0,0,0,.45); font-size: 14px; line-height: 1.4; color: var(--st-k); }
.mada-st .mada-in-app span, .mada-st .mada-in-app p, .mada-st .mada-in-app li, .mada-st .mada-in-app b { color: var(--st-k); }
.mada-st .mada-in-top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--st-line); background: #ffffff; }
.mada-st .mada-in-logo { font: 900 1.05rem/1 var(--st-head); letter-spacing: -0.02em; }
.mada-st .mada-in-app .mada-in-logo span { color: var(--st-y); }
.mada-st .mada-in-app .mada-in-azienda { font-size: .82rem; color: #6b6b6b; }
.mada-st .mada-in-badge { margin-left: auto; padding: 3px 10px; border-radius: 99px; background: var(--st-y); font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.mada-st .mada-in-body { display: grid; grid-template-columns: 128px minmax(0, 1fr); }
.mada-st .mada-in-menu { display: flex; flex-direction: column; gap: 2px; padding: 14px 10px; border-right: 1px solid var(--st-line); background: #ffffff; }
.mada-st .mada-in-app .mada-in-menu span { flex: none; padding: 8px 10px; border-radius: 10px; font-size: .82rem; font-weight: 600; color: #5a5a5a; }
.mada-st .mada-in-app .mada-in-menu span.attiva { background: var(--st-k); color: #ffffff; }
.mada-st .mada-in-main { display: grid; gap: 12px; min-width: 0; padding: 16px; }
.mada-st .mada-in-kpi { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.mada-st .mada-in-kpi div { padding: 12px; border: 1px solid var(--st-line); border-radius: 12px; background: #ffffff; }
.mada-st .mada-in-app .mada-in-kpi span { display: block; font-size: .7rem; font-weight: 600; color: #6b6b6b; }
.mada-st .mada-in-kpi b { display: block; margin: 4px 0 2px; font: 800 1.25rem/1.1 var(--st-head); letter-spacing: -0.01em; }
.mada-st .mada-in-kpi small { font-size: .7rem; font-weight: 700; color: var(--st-ok); }
.mada-st .mada-in-kpi small.ko { color: var(--st-ko); }
.mada-st .mada-in-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 12px; }
.mada-st .mada-in-box { min-width: 0; padding: 12px 14px; border: 1px solid var(--st-line); border-radius: 12px; background: #ffffff; }
.mada-st .mada-in-app .mada-in-t { margin: 0 0 10px; font-size: .8rem; font-weight: 700; }
.mada-st .mada-in-barre { display: flex; align-items: flex-end; gap: 6px; height: 110px; }
.mada-st .mada-in-barre i { flex: 1; border-radius: 6px 6px 2px 2px; background: #d9d6cc; }
.mada-st .mada-in-barre i.ora { background: var(--st-y); }
.mada-st .mada-in-sett { display: flex; justify-content: space-between; gap: 6px; margin-top: 6px; }
.mada-st .mada-in-app .mada-in-sett span { flex: 1; font-size: .66rem; text-align: center; color: #8a877f; }
.mada-st .mada-in-lista li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 0; border-top: 1px solid #efede7; font-size: .8rem; }
.mada-st .mada-in-lista li:first-child { border-top: 0; }
.mada-st .mada-in-lista li > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mada-st .mada-in-stato { flex: none; padding: 2px 8px; border-radius: 99px; font-size: .66rem; font-weight: 700; white-space: nowrap; }
.mada-st .mada-in-app .s-spedire { background: #fff3c4; }
.mada-st .mada-in-app .s-fatturato { background: #e3f0e7; color: var(--st-ok); }
.mada-st .mada-in-app .s-magazzino { background: #ece9e1; }
.mada-st .mada-in-app .s-scaduta { background: #fbe4e2; color: var(--st-ko); }

@container (max-width: 620px) {
  .mada-st .mada-in-body { grid-template-columns: minmax(0, 1fr); }
  .mada-st .mada-in-menu { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--st-line); scrollbar-width: none; }
  .mada-st .mada-in-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mada-st .mada-in-row { grid-template-columns: minmax(0, 1fr); }
  .mada-st .mada-in-app .mada-in-azienda { display: none; }
}
@media (prefers-reduced-motion: reduce) { .mada-st .mada-cu-barra span, .mada-st .mada-cu-scelte span { transition: none; } }
