/* Martina Gas — tema tipografico condiviso
   Carica Roboto e alleggerisce i pesi del testo per una resa più
   leggibile e professionale, senza modificare le singole classi HTML.
   Collegare DOPO il CDN di Tailwind in ogni pagina. */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700;800;900&display=swap');

/* Font di base su tutta l'interfaccia */
html,
body,
.font-sans {
  font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: 0.005em;
}

/* Rimappa i pesi di Tailwind su valori più morbidi.
   Roboto dispone di 400 / 500 / 700 / 900: usiamo 400-500-700.
   - Le label (font-bold) passano da 700 a 500 (medium, pulito)
   - L'enfasi (font-black/extrabold) passa da 900/800 a 700 */
.font-black    { font-weight: 700 !important; }
.font-extrabold{ font-weight: 700 !important; }
.font-bold     { font-weight: 500 !important; }
.font-semibold { font-weight: 500 !important; }

/* Ammorbidisce il maiuscolo molto spaziato dei testi piccoli */
.uppercase.tracking-widest { letter-spacing: 0.06em; }

/* Icone Material Symbols — allineate al testo, dimensione ereditata da font-size */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  font-size: 1.25em;
  line-height: 1;
  vertical-align: -0.18em;
  user-select: none;
}

/* ===== Design system Refuel (Blocco 1) ===== */
:root {
  --teal:        #1AA7A2;
  --teal-scuro:  #15807c;
  --teal-chiaro: #e6f7f6;
  --ink:         #0f1b2d;   /* testo forte / intestazioni scure */
  --app-bg:      #f6f8fa;   /* sfondo applicazione */
  --surface:     #ffffff;   /* superfici / card */
  --bordo:       #e6eaef;
  --testo:       #334155;
  --testo-tenue: #94a3b8;
  --ok:          #0f8a85;
  --rosso:       #E31B22;   /* Martina */
  --giallo:      #FDD835;   /* Martina */
}

/* Bottoni */
.ms-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  font-weight: 900; font-size: 12px; text-transform: uppercase;
  letter-spacing: .03em; padding: 7px 15px; border-radius: 8px;
  border: none; cursor: pointer; line-height: 1;
}
.ms-btn-teal { background: var(--teal); color: #fff; }
.ms-btn-teal:hover { background: var(--teal-scuro); }
.ms-btn-ghost { background: #f1f5f9; color: var(--testo); }

/* Card / KPI */
.ms-card { background: var(--surface); border: 1px solid var(--bordo); border-radius: 11px; }
.ms-kpi  { background: var(--surface); border: 1px solid var(--bordo); border-radius: 9px;
           padding: 8px 11px; display: flex; flex-direction: column; gap: 1px; }
.ms-kpi .l { font-size: 9px; text-transform: uppercase; letter-spacing: .06em;
             font-weight: 800; color: var(--testo-tenue); }
.ms-kpi .v { font-size: 16px; font-weight: 900; color: var(--ink); }

/* Input */
.ms-input { width: 100%; padding: 8px 11px; border-radius: 8px; box-sizing: border-box;
            border: 1px solid var(--bordo); background: #fff; font-weight: 700; font-size: 13px;
            color: var(--ink); outline: none; }
.ms-input:focus { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal-chiaro); }

/* Tabella */
.ms-tabella { background: var(--surface); border: 1px solid var(--bordo); border-radius: 10px; overflow: hidden; }
.ms-tabella table { width: 100%; border-collapse: collapse; }
.ms-tabella thead th { background: #f1f5f9; color: #7c8ba0; text-align: left;
  font-size: 9px; text-transform: uppercase; letter-spacing: .05em; font-weight: 800;
  padding: 7px 14px; border-bottom: 1px solid var(--bordo); }
.ms-tabella tbody td { padding: 7px 14px; font-size: 12.5px; font-weight: 700;
  color: var(--testo); border-bottom: 1px solid #f3f5f8; }
.ms-tabella tbody tr:nth-child(even) td { background: #f8fafc; }
.ms-tabella tbody tr:last-child td { border-bottom: none; }
.ms-tabella .num { text-align: right; font-variant-numeric: tabular-nums; }
.ms-tabella tfoot td { padding: 8px 14px; font-size: 12.5px; font-weight: 900; color: var(--ink);
  background: #f8fafc; border-top: 1.5px solid #cbd5e1; }

/* Badge / pill */
.ms-badge { background: var(--teal-chiaro); color: var(--ok); font-size: 10px; font-weight: 800;
  padding: 2px 8px; border-radius: 20px; display: inline-block; }
.ms-pill { background: #f1f5f9; border: 1px solid var(--bordo); border-radius: 8px;
  padding: 5px 10px; font-size: 12px; font-weight: 800; color: var(--testo); }
.ms-pill b { color: var(--ok); }

/* ===== Guscio desktop ===== */
.ms-shell { position: relative; }
.ms-topbar { background: var(--teal); display: flex; align-items: center; gap: 14px;
  padding: 4px 14px; min-height: 46px; }
.ms-menu-btn { display: none; background: rgba(255,255,255,.18); border: none; color: #fff;
  font-size: 13px; font-weight: 800; border-radius: 7px; padding: 7px 12px; cursor: pointer; line-height: 1; }
.ms-logo { height: 26px; width: auto; background: #fff; border-radius: 5px; padding: 2px 6px; }
.ms-nav { display: flex; gap: 2px; flex-wrap: wrap; }
.ms-nav-link { padding: 6px 11px; border-radius: 7px; font-size: 12.5px; font-weight: 700;
  color: #d7f2f0; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.ms-nav-link:hover { background: rgba(255,255,255,.14); color: #fff; }
.ms-nav-link.on { background: rgba(255,255,255,.22); color: #fff; }
.ms-user { margin-left: auto; display: flex; align-items: center; gap: 12px;
  color: #eafbfa; font-size: 12px; font-weight: 700; white-space: nowrap; }
.ms-exit { color: #c7ece9; text-decoration: none; }
.ms-exit:hover { color: #fff; }
/* sotto-header di pagina */
.ms-subhead { background: #fff; border-bottom: 1px solid var(--bordo);
  padding: 8px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ms-subhead h1 { font-size: 14px; font-weight: 900; color: var(--ink); margin: 0; }
.ms-subhead .ctx { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* riepilogo Erogato / Incassato / Quadratura: tutta larghezza, carattere adattivo.
   Importi tipici ~ "€ 20.345,67" (11 caratteri): il clamp è tarato per farli stare
   su 3 colonne anche a 360px senza andare a capo. */
.ms-riep { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.ms-riep .l { font-size: clamp(9px, 2.4vw, 11px); text-transform: uppercase;
  letter-spacing: .05em; font-weight: 800; color: var(--testo-tenue); margin: 0; }
.ms-riep .v { font-size: clamp(12.5px, 4.1vw, 20px); font-weight: 900; white-space: nowrap;
  font-variant-numeric: tabular-nums; margin: 0; line-height: 1.25; }

/* ===== Mobile: nav a tendina con hamburger ===== */
@media (max-width: 900px) {
  .ms-menu-btn { display: inline-flex; align-items: center; gap: 6px; }
  .ms-nav { display: none; }
  .ms-nav.open { display: flex; flex-direction: column; gap: 4px;
    position: absolute; top: 100%; left: 0; right: 0; z-index: 70;
    background: var(--teal); padding: 8px 12px 14px;
    box-shadow: 0 12px 24px rgba(15,23,42,.28); border-radius: 0 0 12px 12px; }
  .ms-nav.open .ms-nav-link { padding: 12px 14px; font-size: 15px; border-radius: 9px; }
  .ms-hi { display: none; }
  .ms-subhead { flex-direction: column; align-items: stretch; }
  .ms-subhead .ctx { row-gap: 6px; }
}
