/* ============================================================
   QualEASY — Design System
   Ispirato allo stile Apple: superfici chiare, angoli morbidi,
   ombre leggere, pulsanti a pillola, tipografia di sistema.
   ============================================================ */

:root {
  --blue: #0a9d98;
  --blue-hover: #078a86;
  --blue-light: #e3f6f5;
  --tiffany: #0abab5;
  --tiffany-hover: #078a86;
  --violet: #0abab5;
  --violet-hover: #078a86;
  --violet-light: #e3f6f5;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --border: rgba(0,0,0,.06);
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --green-bg: #e6f9ed; --green-text: #1a7f37;
  --orange-bg: #fff4e0; --orange-text: #a15c00;
  --red-bg: #ffe9e8; --red-text: #d70015;
  --gray-bg: #f0f0f2; --gray-text: #6e6e73;
  --yellow-bg: #fff9db; --yellow-text: #8a6d00;
  --radius-card: 18px;
  --radius-control: 12px;
  --radius-pill: 980px;
  --shadow-card: 0 2px 10px rgba(0,0,0,.05);
  --shadow-hover: 0 6px 20px rgba(0,0,0,.09);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Top nav ---------- */
.topnav {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(90deg, rgba(255,255,255,.88) 0%, rgba(246,251,251,.9) 55%, rgba(227,246,245,.88) 100%);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(10,186,181,.14);
  box-shadow: 0 1px 0 rgba(10,186,181,.05);
  padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px;
}
.topnav .brand { font-weight: 600; font-size: 16px; letter-spacing: -.01em; color: var(--text); text-decoration: none; display:flex; align-items:center; gap:8px; }
.topnav .brand .dot { width:8px; height:8px; border-radius:50%; background:var(--blue); display:inline-block; }
.topnav .brand .brand-logo { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; display: inline-block; }
.topnav nav { display: flex; align-items: center; gap: 4px; }
.topnav nav a {
  color: var(--text-secondary); text-decoration: none; font-size: 13.5px;
  padding: 7px 14px; border-radius: var(--radius-pill); transition: background .18s ease, color .18s ease, box-shadow .18s ease, transform .15s ease;
}
.topnav nav a:hover {
  background: linear-gradient(135deg, var(--violet), var(--violet-hover));
  color: #fff; box-shadow: 0 3px 10px rgba(10,186,181,.35); transform: translateY(-1px);
}
.topnav nav a.nav-verde:hover:not(.attivo) {
  background: var(--green-bg); color: var(--green-text); box-shadow: 0 3px 10px rgba(52,199,89,.25);
}
.topnav nav a.attivo {
  background: linear-gradient(135deg, var(--violet), var(--violet-hover));
  color: #fff; box-shadow: 0 3px 10px rgba(10,186,181,.3);
}
.topnav .nav-divider { width: 1px; height: 24px; background: rgba(10,186,181,.18); margin: 0 10px; flex-shrink: 0; }
.topnav .utente-chip {
  display: flex; align-items: center; gap: 8px; padding: 4px 14px 4px 5px;
  border-radius: var(--radius-pill); background: var(--violet-light); margin-right: 4px;
}
.topnav .utente-chip .avatar {
  width: 25px; height: 25px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--violet), var(--violet-hover)); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
}
.topnav .utente-chip .nome {
  font-size: 13.5px; font-weight: 600; color: var(--violet-hover); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 150px;
}
.topnav .logout-link { color: var(--text-secondary) !important; font-size: 13px !important; }
.topnav .logout-link:hover { background: var(--red-bg) !important; color: var(--red-text) !important; box-shadow: none !important; transform: none !important; }

/* ---------- Layout ---------- */
main.container { max-width: 1180px; margin: 0 auto; padding: 32px 24px 64px; }
main.container.stretta { max-width: 760px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 14px; margin-bottom: 24px; }
.page-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.saluto-iphone {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif !important;
  font-weight: 800 !important; font-size: 44px !important; letter-spacing: -.03em !important;
  color: var(--text);
}
.page-head .sub { color: var(--text-secondary); font-size: 14px; margin-top: 4px; }

.back-link { display:inline-flex; align-items:center; gap:4px; color: var(--blue); text-decoration:none; font-size: 14px; margin-bottom: 14px; }
.back-link:hover { text-decoration: underline; }

/* ---------- Buttons (Apple pill style) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; cursor: pointer; text-decoration: none;
  font-size: 14px; font-weight: 590; letter-spacing: -.01em;
  padding: 10px 20px; border-radius: var(--radius-pill);
  transition: transform .1s ease, background .15s ease, box-shadow .15s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); }
.btn-secondary { background: var(--gray-bg); color: var(--text); }
.btn-secondary:hover { background: #e4e4e8; }
.btn-danger-text { background: transparent; color: var(--red-text); padding: 10px 14px; }
.btn-danger-text:hover { background: var(--red-bg); }
.btn-sm { padding: 6px 14px; font-size: 12.5px; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  padding: 28px;
}
.card + .card { margin-top: 20px; }
.card h2, .card h3 {
  margin: 0 0 18px; font-size: 15px; font-weight: 600; color: var(--text);
  padding-bottom: 14px; border-bottom: 1px solid var(--border);
}

.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.tile {
  background: var(--surface); border-radius: var(--radius-card); border: 1px solid var(--border);
  box-shadow: var(--shadow-card); padding: 26px 22px; text-decoration: none; color: var(--text);
  transition: box-shadow .2s ease, transform .2s ease; display:block;
}
.tile:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.tile .icon { font-size: 26px; margin-bottom: 12px; display:block; }
.tile .titolo { font-weight: 600; font-size: 15.5px; letter-spacing: -.01em; }
.tile .sotto { display: block; font-weight: 400; color: var(--text-secondary); font-size: 12.5px; margin-top: 4px; }

/* App: tile principali, con evidenza (viola soft), dimensione compatta per stare in una sola pagina */
.tile-grid-app { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 4px; }
@media (max-width: 1000px) { .tile-grid-app { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
.tile-app {
  padding: 14px 12px;
  border: 1px solid rgba(10,186,181, .12);
  box-shadow: 0 2px 10px rgba(10,186,181, .06);
}
.tile-app .icon { font-size: 22px; margin-bottom: 6px; }
.tile-app .titolo { font-size: 13px; line-height: 1.25; color: #2d4a49; }
.tile-app .sotto { font-size: 10.5px; line-height: 1.3; margin-top: 3px; color: #6fa09d; }
.tile-app:hover { box-shadow: 0 8px 24px rgba(10,186,181, .14); }

.tile-grid-app .tile-app:nth-child(1) { background: linear-gradient(135deg, #ffffff 0%, #c4e8e6 100%); }
.tile-grid-app .tile-app:nth-child(2) { background: linear-gradient(135deg, #e6f6f5 0%, #9bdad6 100%); }
.tile-grid-app .tile-app:nth-child(3) { background: linear-gradient(135deg, #d6f0ee 0%, #6ccbc5 100%); }
.tile-grid-app .tile-app:nth-child(4) { background: linear-gradient(135deg, #bfe6e3 0%, #4cc3bd 100%); }
.tile-grid-app .tile-app:nth-child(4) .titolo { color: #1f6662; }
.tile-grid-app .tile-app:nth-child(4) .sotto { color: #448783; }
.tile-grid-app .tile-app:nth-child(5) { background: linear-gradient(135deg, #a8dfdb 0%, #66dad3 100%); }
.tile-grid-app .tile-app:nth-child(5) .titolo { color: #1d3a39; }
.tile-grid-app .tile-app:nth-child(5) .sotto { color: #387874; }
.tile-grid-app .tile-app:nth-child(6) { background: linear-gradient(135deg, #8ed5d0 0%, #50d2ca 100%); }
.tile-grid-app .tile-app:nth-child(6) .titolo { color: #113b38; }
.tile-grid-app .tile-app:nth-child(6) .sotto { color: #286662; }

/* Scadenziari e Tools: tile più compatte */
.tile-grid-mini { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tile-mini { padding: 16px 16px; }
.tile-mini .icon { font-size: 18px; margin-bottom: 6px; }
.tile-mini .titolo { font-size: 13px; }
.tile-mini .sotto { font-size: 11px; margin-top: 2px; }

/* Tools: lilla più chiaro delle tile App, per distinguerle a colpo d'occhio */
.tile-tools { background: #f6fbfb; border: 1px solid rgba(10,186,181, .10); }
.tile-tools .titolo { color: #2d4a49; }
.tile-tools .sotto { color: #8a9594; }
.tile-tools:hover { box-shadow: 0 6px 18px rgba(10,186,181, .10); }

.section-label { color: var(--text-secondary); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin: 20px 0 10px; }
.section-label-row { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 10px; }
.section-label-row .section-label { margin: 0; }
.btn-doc-esterni { background: var(--blue-light); color: var(--blue); font-weight: 600; padding: 8px 14px; font-size: 13px; white-space: nowrap; }
.head-btns { display: flex; gap: 8px; flex-wrap: nowrap; justify-content: flex-end; }
@media (max-width: 800px) { .head-btns { flex-wrap: wrap; } }
.btn-doc-esterni:hover { background: #d6f0ee; }

/* ---------- Stat tiles ---------- */
.stat-row { display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.stat {
  flex: 1; min-width: 180px; border-radius: var(--radius-card); padding: 20px 22px;
  box-shadow: var(--shadow-card); border: 1px solid var(--border);
}
.stat .num { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.stat .lbl { font-size: 13px; margin-top: 2px; opacity: .85; }
.stat.rosso { background: var(--red-bg); color: var(--red-text); }
.stat.arancio { background: var(--orange-bg); color: var(--orange-text); }
.stat.verde { background: var(--green-bg); color: var(--green-text); }
.stat.neutro { background: var(--surface); color: var(--text); }
.stat.giallo { background: var(--yellow-bg); color: var(--yellow-text); }
a.stat { text-decoration: none; display: block; transition: box-shadow .2s ease, transform .2s ease; }
a.stat:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }

/* Indicatori: versione compatta per la home */
.stat-row-mini { gap: 8px; margin-bottom: 28px; flex-wrap: nowrap; }
.stat-mini { padding: 9px 12px; min-width: 0; }
.stat-mini .num { font-size: 17px; }
.stat-mini .lbl { font-size: 10.5px; line-height: 1.25; }
@media (max-width: 900px) { .stat-row-mini { flex-wrap: wrap; } .stat-mini { min-width: 140px; } }

/* ---------- Tabs (segmented control) ---------- */
.segmented { display: inline-flex; background: var(--gray-bg); border-radius: var(--radius-pill); padding: 3px; margin-bottom: 20px; gap: 2px; flex-wrap: wrap; }
.segmented a, .segmented button {
  text-decoration: none; color: var(--text-secondary); font-size: 13.5px; font-weight: 500;
  padding: 7px 16px; border-radius: var(--radius-pill); transition: all .15s ease;
  border: none; background: transparent; cursor: pointer; font-family: inherit;
}
.segmented a.attivo, .segmented button.attivo { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
#risk-tabs button[data-tab="tab-rischi"].attivo { background: var(--red-bg); color: var(--red-text); box-shadow: none; }
#risk-tabs button[data-tab="tab-opportunita"].attivo { background: linear-gradient(135deg, var(--blue), var(--blue-hover)); color: #fff; box-shadow: 0 2px 8px rgba(10,186,181,.3); }

/* ---------- Table ---------- */
.table-wrap { background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); border: 1px solid var(--border); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 16px; text-align: left; font-size: 14px; }
th { background: var(--gray-bg); color: var(--text-secondary); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; }
tbody tr { border-top: 1px solid var(--border); }
tbody tr:hover { background: #fafafc; }
.table-empty { text-align: center; padding: 60px 20px; color: var(--text-secondary); font-size: 14.5px; }
.row-actions a { font-size: 13px; text-decoration: none; color: var(--blue); margin-right: 14px; font-weight: 500; }
.row-actions a.del { color: var(--red-text); }

/* ---------- Badges / pills ---------- */
.pill { display: inline-block; padding: 4px 12px; border-radius: var(--radius-pill); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.pill-green { background: var(--green-bg); color: var(--green-text); }
.pill-orange { background: var(--orange-bg); color: var(--orange-text); }
.pill-red { background: var(--red-bg); color: var(--red-text); }
.pill-gray { background: var(--gray-bg); color: var(--gray-text); }
.pill-yellow { background: var(--yellow-bg); color: var(--yellow-text); }
.pill-violet { background: var(--violet-light); color: var(--violet-hover); }

.stato-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.stato-dot.rosso { background: var(--red-text); }
.stato-dot.verde { background: var(--green-text); }
.stato-dot.grigio { background: var(--gray-text); }
/* ---------- Piani di miglioramento (PDCA) ---------- */
.mig-flag { text-decoration: none; font-size: 20px; color: #a3eae6; line-height: 1; }
.mig-flag:hover { color: var(--violet); }
.mig-steps { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.mig-step { display: flex; align-items: center; gap: 8px; padding: 8px 16px 8px 8px; border-radius: var(--radius-pill); background: var(--gray-bg); color: var(--text-secondary); font-weight: 600; font-size: 13.5px; }
.mig-step .lettera { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); font-weight: 700; font-size: 13px; }
.mig-step.attivo { background: linear-gradient(135deg, var(--violet), var(--violet-hover)); color: #fff; }
.mig-step.attivo .lettera { color: var(--violet-hover); }
.mig-step.fatto { background: var(--green-bg); color: var(--green-text); }
.mig-chiuso { margin-left: 6px; font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.card-smart { background: linear-gradient(135deg, var(--violet-light) 0%, #eef9f8 100%); }
.mig-frase { font-size: 17px; font-weight: 600; line-height: 1.45; margin: 0 0 14px; }
.mig-smart { display: flex; flex-wrap: wrap; gap: 8px; }
.mig-smart-chip { padding: 5px 14px; border-radius: var(--radius-pill); background: var(--surface); color: var(--text-secondary); font-size: 12.5px; border: 1px dashed #8ed5d0; }
.mig-smart-chip b { color: var(--violet-hover); margin-right: 2px; }
.mig-smart-chip.ok { background: var(--green-bg); color: var(--green-text); border: 1px solid transparent; }
.mig-smart-chip.ok b { color: var(--green-text); }
.mig-bar { height: 8px; background: var(--gray-bg); border-radius: 4px; overflow: hidden; margin: 8px 0 4px; max-width: 280px; }
.mig-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--violet), var(--blue)); border-radius: 4px; }
.mig-check { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 7px; border: 2px solid #c7c7cc; color: #fff; text-decoration: none; font-weight: 700; font-size: 14px; }
.mig-check:hover { border-color: var(--green-text); }
.mig-check.on { background: var(--green-text); border-color: var(--green-text); }
tr.mig-fatta td { color: var(--text-secondary); }
tr.mig-fatta td:nth-child(2) { text-decoration: line-through; }
.mig-azione-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mig-azione-form input { margin: 0; width: auto; }
.mig-azione-form input[type=date] { flex: 0 0 150px; }
.mig-details summary { cursor: pointer; font-weight: 700; font-size: 16px; }
.mig-details summary small { font-weight: 400; color: var(--text-secondary); font-size: 12.5px; }

/* ---------- Organigramma ---------- */
.org-wrap { background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 18px 12px; overflow-x: auto; }
.org-wrap a:hover rect:first-of-type { stroke-width: 2.4; }
.org-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; margin-top: 14px; font-size: 12.5px; color: var(--text-secondary); }
.org-legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 6px; }
.org-leg-vertice { background: linear-gradient(135deg, #7bf8f1, #09a5a0); }
.org-leg-primo { background: linear-gradient(135deg, #2b8cf0, #0066cc); }
.org-leg-altri { background: #fff; border: 1.4px solid #c9cedb; border-left: 4px solid #0abab5; }
.org-leg-staff { background: #e8f8f7; border: 1.4px dashed #0abab5; }
@media print { .org-wrap { box-shadow: none; padding: 0; overflow: visible; } }

/* ---------- Fornitori ---------- */
.for-star { text-decoration: none; font-size: 20px; color: #c7c7cc; line-height: 1; }
.for-star.on, .for-star:hover { color: #f5a623; }
.for-chip { display: inline-block; padding: 3px 10px; border-radius: var(--radius-pill); background: var(--gray-bg); font-size: 11.5px; color: var(--text-secondary); margin: 0 4px 4px 0; white-space: nowrap; }
.for-chip b { color: var(--text); }
.for-chip.pill-green { background: var(--green-bg); color: var(--green-text); }
.for-chip.pill-orange { background: var(--orange-bg); color: var(--orange-text); }
.for-chip.pill-red { background: var(--red-bg); color: var(--red-text); }
.for-chip.pill-green b, .for-chip.pill-orange b, .for-chip.pill-red b { color: inherit; }
.for-score-big.pill-green { color: var(--green-text); }
.for-score-big.pill-orange { color: var(--orange-text); }
.for-score-big.pill-red { color: var(--red-text); }
.for-scale label { min-width: 64px; padding: 10px 4px; font-size: 14px; }
.for-param { margin-bottom: 18px; }
.for-param .titolo { display: block; font-weight: 600; margin-bottom: 8px; }
.for-score-big { font-size: 38px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.for-trend { font-size: 13px; font-weight: 600; margin-left: 8px; }
.for-trend.su { color: var(--green-text); }
.for-trend.giu { color: var(--red-text); }

.stato-taratura { display: inline-flex; align-items: center; font-size: 13px; color: var(--text-secondary); white-space: nowrap; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.form-grid.full { grid-template-columns: 1fr; }
.field label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--text); }
.field .hint { color: var(--text-secondary); font-weight: 400; font-size: 12px; }
input[type=text], input[type=date], input[type=number], input[type=email], input[type=tel],
input[type=password], select, textarea {
  width: 100%; padding: 11px 13px; font-size: 14.5px; font-family: inherit;
  border: 1px solid #d2d2d7; border-radius: var(--radius-control);
  background: var(--surface); color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-light);
}
textarea { min-height: 76px; resize: vertical; }

.toggle-row {
  display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 600;
  cursor: pointer; user-select: none;
}
.toggle-row input[type=checkbox] { width: 44px; height: 26px; -webkit-appearance: none; appearance: none;
  background: #e4e4e8; border-radius: var(--radius-pill); position: relative; cursor: pointer; transition: background .2s ease; flex-shrink:0; }
.toggle-row input[type=checkbox]:checked { background: var(--blue); }
.toggle-row input[type=checkbox]::before {
  content:''; position:absolute; top:3px; left:3px; width:20px; height:20px; background:#fff; border-radius:50%;
  transition: transform .2s ease; box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.toggle-row input[type=checkbox]:checked::before { transform: translateX(18px); }

.checkbox-inline { display:flex; align-items:center; gap:8px; font-weight:400; font-size:14px; }
.checkbox-inline input { width:18px; height:18px; }

.allegato-attuale { display:flex; align-items:center; flex-wrap:wrap; gap:6px; padding:10px 14px; background:var(--gray-bg); border-radius:var(--radius-control); font-size:14px; }
.allegato-attuale a { color: var(--blue); text-decoration:none; font-weight:500; }
.allegato-attuale a:hover { text-decoration:underline; }

.alert { padding: 13px 16px; border-radius: var(--radius-control); margin-bottom: 18px; font-size: 14px; }
.alert-success { background: var(--green-bg); color: var(--green-text); }
.alert-error { background: var(--red-bg); color: var(--red-text); }

.form-actions { display: flex; gap: 10px; margin-top: 4px; }

/* ---------- SWOT ---------- */
.swot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 28px; }
@media (max-width: 760px) { .swot-grid { grid-template-columns: 1fr; } }
.swot-quadrant { border-radius: var(--radius-card); padding: 22px; border: 1px solid var(--border); }
.swot-quadrant.forza { background: var(--green-bg); }
.swot-quadrant.debolezza { background: var(--red-bg); }
.swot-quadrant.opportunita { background: var(--blue-light); }
.swot-quadrant.minaccia { background: var(--orange-bg); }
.swot-quadrant h3 { margin: 0 0 12px; font-size: 15px; font-weight: 700; border: none; padding: 0; }
.swot-item { padding: 10px 0; border-top: 1px solid rgba(0,0,0,.08); }
.swot-item:first-of-type { border-top: none; padding-top: 0; }
.swot-item-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.swot-item .testo { font-size: 13.5px; flex: 1; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.swot-item .azioni { white-space: nowrap; }
.swot-item .azioni a { font-size: 12px; margin-left: 10px; text-decoration: none; color: var(--text-secondary); }
.swot-item .azioni a:hover { color: var(--text); }
.btn-genera { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; padding: 6px 14px; border-radius: var(--radius-pill); font-size: 12.5px; font-weight: 700; text-decoration: none; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.btn-genera-rischio { background: var(--red-text); color: #fff; }
.btn-genera-rischio:hover { background: #b8000f; }
.btn-genera-opportunita { background: var(--green-text); color: #fff; }
.btn-genera-opportunita:hover { background: #136129; }

/* ---------- Finestra di Johari: valutazioni individuali ---------- */
.johari-persone { min-width: 190px; }
.johari-persona { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.johari-persona .pill { text-decoration: none; }
.johari-persona .del { font-size: 12px; color: var(--text-secondary); text-decoration: none; }
.johari-persona .del:hover { color: var(--red-text); }

/* ---------- Soddisfazione cliente (CSI) ---------- */
.csi-scale { display: flex; gap: 8px; flex-wrap: wrap; }
.csi-scale input[type=radio] { position: absolute; opacity: 0; width: 0; height: 0; }
.csi-scale label { flex: 1; min-width: 100px; text-align: center; padding: 14px 6px; border-radius: var(--radius-control); border: 2px solid var(--border); cursor: pointer; font-weight: 700; font-size: 15px; background: var(--surface); transition: border-color .15s, background .15s, color .15s; }
.csi-scale label small { display: block; font-weight: 400; font-size: 11px; color: var(--text-secondary); margin-top: 4px; line-height: 1.3; }
.csi-scale input[type=radio]:checked + label { border-color: var(--violet); background: var(--violet); color: #fff; }
.csi-scale input[type=radio]:checked + label small { color: rgba(255,255,255,.85); }
.csi-scale input[type=radio]:focus-visible + label { outline: 2px solid var(--violet); outline-offset: 2px; }
@media (max-width: 480px) { .csi-scale { gap: 6px; } .csi-scale label { min-width: 70px; padding: 10px 4px; font-size: 13px; } }
.swot-empty { font-size: 13px; color: var(--text-secondary); padding: 6px 0 14px; }
.swot-add { display: inline-block; margin-top: 10px; font-size: 13px; font-weight: 600; text-decoration: none; color: var(--text); }
.swot-add:hover { text-decoration: underline; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { background: var(--surface); border-radius: 24px; box-shadow: 0 10px 40px rgba(0,0,0,.1); padding: 40px 36px; width: 100%; max-width: 360px; }
.login-card .logo { width:46px; height:46px; border-radius:13px; background:var(--blue); display:flex; align-items:center; justify-content:center; color:#fff; font-weight:700; font-size:20px; margin-bottom:18px; }
.login-card h1 { font-size: 21px; margin: 0 0 22px; letter-spacing: -.02em; }
.login-card .field { margin-bottom: 16px; }
.login-card .btn { width: 100%; padding: 12px; font-size: 15px; margin-top: 6px; }

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .topnav { padding: 0 14px; }
  main.container { padding: 20px 14px 48px; }
}

/* ---------- Mappa dei processi ---------- */
.map-wrap {
  background: var(--surface); border-radius: var(--radius-card); border: 1px solid var(--border);
  box-shadow: var(--shadow-card); padding: 10px; margin-bottom: 26px; overflow-x: auto; text-align: center;
}
.map-svg { display: inline-block; width: 100%; max-width: 780px; height: auto; animation: mapFadeIn .6s ease both; }
@keyframes mapFadeIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }
.map-svg a { cursor: pointer; }
.map-node { transition: filter .15s ease, stroke-width .15s ease; }
.map-node-g { transition: transform .18s cubic-bezier(.34,1.56,.64,1); }
.map-svg a:hover .map-node-g { transform: scale(1.16); }
.map-svg a:hover .map-node { filter: brightness(1.1); }
.map-node-center { fill: var(--surface); stroke: var(--border); stroke-width: 2; }
.map-node-macro.tipo-direzione { fill: var(--violet); }
.map-node-macro.tipo-primario { fill: var(--blue); }
.map-node-macro.tipo-supporto { fill: var(--tiffany); }
.map-node-proc { fill: var(--surface); stroke-width: 2.5; }
.map-node-proc.tipo-direzione { stroke: var(--violet); }
.map-node-proc.tipo-primario { stroke: var(--blue); }
.map-node-proc.tipo-supporto { stroke: var(--tiffany); }
.map-line-macro { stroke-width: 3; opacity: .55; }
.map-line-macro.tipo-direzione { stroke: var(--violet); }
.map-line-macro.tipo-primario { stroke: var(--blue); }
.map-line-macro.tipo-supporto { stroke: var(--tiffany); }
.map-line-proc { stroke-width: 1.5; opacity: .45; }
.map-line-proc.tipo-direzione { stroke: var(--violet); }
.map-line-proc.tipo-primario { stroke: var(--blue); }
.map-line-proc.tipo-supporto { stroke: var(--tiffany); }
.map-label { font-size: 12px; font-weight: 700; fill: #fff; font-family: inherit; pointer-events: none; }
.map-label-proc { font-size: 10px; font-weight: 600; fill: var(--text); font-family: inherit; pointer-events: none; }
.map-label-center { font-size: 13px; font-weight: 700; fill: var(--text); font-family: inherit; pointer-events: none; }
.map-legend { display: flex; justify-content: center; gap: 22px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; color: var(--text-secondary); }
.map-legend span { display: inline-flex; align-items: center; gap: 7px; }
.map-legend i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.map-legend i.tipo-direzione { background: var(--violet); }
.map-legend i.tipo-primario { background: var(--blue); }
.map-legend i.tipo-supporto { background: var(--tiffany); }
.map-macro-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.map-macro-card { border: 1px solid var(--border); border-radius: var(--radius-control); padding: 13px 16px; }
.map-macro-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.map-macro-head .titolo { display: flex; align-items: center; gap: 8px; min-width: 0; }
.map-macro-head .titolo strong { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-macro-head .resp { color: var(--text-secondary); font-size: 12px; margin-top: 2px; }
.map-icon-group { display: flex; gap: 2px; flex-shrink: 0; }
.map-icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  border-radius: 50%; color: var(--text-secondary); text-decoration: none; font-size: 13.5px;
  transition: background .15s, color .15s;
}
.map-icon-btn:hover { background: var(--gray-bg); color: var(--text); }
.map-icon-btn.elimina:hover { background: var(--red-bg); color: var(--red-text); }
.map-proc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.map-proc-chip {
  display: inline-flex; align-items: center; gap: 2px; background: var(--gray-bg);
  border-radius: var(--radius-pill); padding: 3px 3px 3px 12px; font-size: 12.5px;
}
.map-proc-chip a.nome { color: var(--text); text-decoration: none; }
.map-proc-chip a.nome:hover { text-decoration: underline; }
.map-proc-chip a.audit, .map-proc-chip a.del {
  display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px;
  border-radius: 50%; color: var(--text-secondary); text-decoration: none; font-size: 11px; margin-left: 2px;
}
.map-proc-chip a.audit { font-size: 10px; }
.map-proc-chip a.audit:hover { background: var(--violet-light); color: var(--violet-hover); }
.map-proc-chip a.del:hover { background: var(--red-bg); color: var(--red-text); }
.map-proc-add {
  display: inline-flex; align-items: center; gap: 4px; color: var(--text-secondary); text-decoration: none;
  font-size: 12.5px; padding: 3px 10px; border-radius: var(--radius-pill); border: 1px dashed var(--border);
}
.map-proc-add:hover { color: var(--blue); border-color: var(--blue); }
.map-proc-empty { color: var(--text-secondary); font-size: 12.5px; margin-top: 10px; font-style: italic; }
@media (max-width: 640px) {
  .map-wrap { padding: 14px; }
  .map-macro-grid { grid-template-columns: 1fr; }
}

/* ---------- Audit interni ---------- */
.card-evidenze {
  background: linear-gradient(135deg, var(--violet-light) 0%, #eef9f8 100%);
  border: 1px solid rgba(10,186,181,.28);
  box-shadow: 0 2px 12px rgba(10,186,181,.1);
}
.audit-evidenze-list { list-style: none; margin: 0 0 16px; padding: 0; }
.audit-evidenze-list li {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; font-size: 14px;
  background: var(--surface); border-radius: var(--radius-control); margin-bottom: 8px;
  border: 1px solid rgba(10,186,181,.14);
}
.audit-evidenze-list li:last-child { margin-bottom: 0; }
.audit-evidenze-list .punto { color: var(--violet); font-weight: 700; line-height: 1.5; }
.audit-evidenze-list .testo { flex: 1; line-height: 1.5; }
.audit-evidenze-list .azioni { display: flex; gap: 2px; flex-shrink: 0; }
.audit-evidenze-list .mod, .audit-evidenze-list .del {
  flex-shrink: 0; color: var(--text-secondary); text-decoration: none; font-size: 12px;
  width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
}
.audit-evidenze-list .mod:hover { background: var(--violet-light); color: var(--violet-hover); }
.audit-evidenze-list .del:hover { background: var(--red-bg); color: var(--red-text); }
.audit-evidenza-form, .audit-nc-form { display: flex; gap: 10px; flex-wrap: wrap; }
.audit-evidenza-form input[type=text] {
  flex: 1; min-width: 220px; background: var(--surface); border-color: rgba(10,186,181,.3);
}
.audit-evidenza-form .btn-secondary {
  background: var(--violet); color: #fff; border: none;
}
.audit-evidenza-form .btn-secondary:hover { background: var(--violet-hover); }
.audit-nc-form select { flex: 1; min-width: 260px; }

/* ---------- Stampa / PDF ---------- */
.print-header { display: none; }
@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
  .topnav { display: none; }
  main.container { max-width: 100%; padding: 0; margin: 0; }
  .print-header {
    display: block; margin-bottom: 18px;
  }
  .print-header .titolo { font-size: 20px; font-weight: 700; margin: 0 0 4px; }
  .print-header .data-stampa { font-size: 12px; color: #555; }
  .card, .table-wrap, .stat {
    box-shadow: none !important; border: 1px solid #ccc !important;
  }
  .stat-row { break-inside: avoid; }
  table { font-size: 12px; }
  th, td { padding: 8px 10px; }
  th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pill { border: 1px solid rgba(0,0,0,.2); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tab-pane { display: block !important; }
  .segmented { display: none !important; }
  a { color: inherit !important; text-decoration: none !important; }
  @page { margin: 1.5cm; }
}

/* Upcoming: avvisi tondi a pillola */
.alert-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; }
.alert-pill {
  display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 22px 8px 8px; box-shadow: var(--shadow-card); min-width: 230px;
  transition: box-shadow .2s ease, transform .2s ease;
}
.alert-pill:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.alert-pill .alert-ico { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 19px; background: var(--green-bg); flex: none; }
.alert-pill .alert-testo { display: flex; flex-direction: column; line-height: 1.25; }
.alert-pill .alert-testo b { font-size: 14px; }
.alert-pill .alert-testo small { font-size: 11.5px; opacity: .75; }
.alert-pill.rosso { background: var(--red-bg); color: var(--red-text); border-color: transparent; }
.alert-pill.rosso .alert-ico { background: #fff; }
.alert-pill .alert-num { margin-left: auto; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; background: var(--red-text); color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* Riesame di direzione */
.rie-banda { margin: 26px 0 12px; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); border-bottom: 2px solid var(--blue-light); padding-bottom: 6px; }
.rie-banda small { text-transform: none; letter-spacing: 0; font-weight: 500; opacity: .7; }
.rie-sez { padding: 16px 22px; }
.rie-testa { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.rie-testa h3 { margin: 0; font-size: 15px; flex: 1; min-width: 200px; }
.rie-rif { font-size: 11px; font-weight: 700; color: var(--blue); background: var(--blue-light); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.rie-apri { font-size: 12px; text-decoration: none; }
.rie-voci { display: grid; grid-template-columns: minmax(170px, 34%) 1fr; gap: 4px 16px; margin: 0; font-size: 13.5px; }
.rie-voci dt { color: var(--text-muted, #6e6e73); }
.rie-voci dd { margin: 0; font-weight: 500; }
.rie-comm { margin-top: 10px; padding: 8px 12px; background: var(--blue-light); border-radius: 12px; font-size: 13px; }
@media (max-width: 700px) { .rie-voci { grid-template-columns: 1fr; } .rie-voci dd { margin-bottom: 6px; } }
@media print { .rie-sez, .rie-banda { break-inside: avoid; } }

/* Riesame: riepilogo in testa alla scheda */
.rie-riepilogo { padding: 20px 24px; }
.rie-info { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.rie-info span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted, #6e6e73); margin-bottom: 3px; }
.rie-info b { font-size: 14.5px; font-weight: 600; }
.rie-sintesi-titolo { margin: 16px 0 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted, #6e6e73); }
.rie-sintesi { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.rie-sintesi div { border-radius: 14px; padding: 10px 14px; display: flex; align-items: baseline; gap: 8px; }
.rie-sintesi b { font-size: 24px; font-weight: 700; line-height: 1; }
.rie-sintesi span { font-size: 12.5px; font-weight: 500; }
.rie-sintesi .verde { background: var(--green-bg); color: var(--green-text); }
.rie-sintesi .arancio { background: var(--orange-bg); color: var(--orange-text); }
.rie-sintesi .rosso { background: var(--red-bg); color: var(--red-text); }
.rie-sintesi .grigio { background: #f0f0f2; color: #6e6e73; }
.solo-stampa { display: none; }
@media (max-width: 800px) { .rie-info, .rie-sintesi { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media print {
  .rie-head { display: none !important; }
  .solo-stampa { display: inline !important; }
  .rie-riepilogo { padding: 14px 18px; }
  .rie-sintesi div, .rie-rif, .pill, .rie-comm { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Test di consapevolezza */
.con-riga { display: grid; grid-template-columns: minmax(0, 1fr) 160px auto; gap: 14px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.con-riga:last-child { border-bottom: none; }
.con-testo { font-size: 13.5px; }
.con-barra { height: 10px; background: #eceef1; border-radius: 999px; overflow: hidden; }
.con-barra span { display: block; height: 100%; border-radius: 999px; background: #8e8e93; }
.con-barra .verde { background: #34c759; } .con-barra .arancio { background: #ff9f0a; } .con-barra .rosso { background: #ff3b30; }
.con-dip { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 18px; }
@media (max-width: 700px) { .con-riga { grid-template-columns: 1fr auto; } .con-barra { grid-column: 1 / -1; order: 3; } }

.sub-motto { color: var(--violet); }

/* Politica e obiettivi */
.pol-card { padding: 20px 24px; margin-bottom: 18px; }
.pol-testa { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.pol-testa h2 { margin: 0; }
.pol-azioni { margin-left: auto; display: flex; gap: 14px; align-items: center; font-size: 13px; }
.pol-testo { margin: 0 0 8px; line-height: 1.55; white-space: normal; }
.pol-impegni-titolo { margin: 16px 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted, #6e6e73); }
.pol-impegni { display: flex; flex-wrap: wrap; gap: 6px; }
.pol-x { margin-left: 6px; color: #999; text-decoration: none; }
.pol-x:hover { color: var(--red-text); }
.pol-foglio { padding: 40px 48px; max-width: 800px; margin: 0 auto; }
.pol-foglio h1 { text-align: center; margin: 0 0 24px; }
.pol-grande { font-size: 17px; line-height: 1.7; }
.pol-lista { font-size: 15px; line-height: 1.8; }
.pol-firma { margin-top: 36px; padding-top: 14px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--text-secondary); }
@media print { .pol-foglio { box-shadow: none; border: none; } }

/* Chip utente cliccabile (profilo) */
.topnav nav a.utente-chip, .topnav nav a.utente-chip:hover { background: var(--violet-light); box-shadow: none; transform: none; padding: 4px 14px 4px 5px; }
.topnav nav a.utente-chip:hover .nome { text-decoration: underline; }
.topnav nav a.utente-chip .nome { color: var(--violet-hover); }

/* Ordini: elenco del riesame */
.ord-check { list-style: none; margin: 0 0 12px; padding: 0; line-height: 1.9; }
.ord-check .si { color: var(--green-text); }
.ord-check .no { color: var(--text-secondary); }

/* Tools compatti */
.tool-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tool-chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; background: #f6fbfb; border: 1px solid rgba(10,186,181, .14); color: #2d4a49; font-size: 13px; font-weight: 500; text-decoration: none; transition: box-shadow .15s, transform .15s; }
.tool-chip span { font-size: 15px; }
.tool-chip:hover { box-shadow: 0 4px 14px rgba(10,186,181, .14); transform: translateY(-1px); }

/* Registro modifiche */
.log-det summary { cursor: pointer; list-style: none; }
.log-det summary::-webkit-details-marker { display: none; }
.log-det[open] summary { margin-bottom: 8px; }
.log-diff { width: 100%; border-collapse: collapse; font-size: 12.5px; background: #f8fafa; border-radius: 10px; overflow: hidden; }
.log-diff th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #7b8584; padding: 6px 10px; background: #edf3f3; }
.log-diff td { padding: 6px 10px; border-top: 1px solid #e4eeee; vertical-align: top; }
.log-diff td.prima { color: #b42318; }
.log-diff td.dopo { color: #157347; }
.log-data { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #66706f; }
.log-filtri select, .log-filtri input { min-width: 0; }
@media print { .log-det > summary .hint { display: none; } }
.log-filtri select { flex: 0 0 190px; }

/* Ricerca globale */
.topsearch { margin-left: 14px; margin-right: auto; flex: 0 1 170px; min-width: 110px; }
.topnav nav a { white-space: nowrap; }
.topsearch input { width: 100%; padding: 7px 14px 7px 32px; border-radius: 999px; border: 1px solid rgba(10,186,181, .18); background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%238a9594' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='6' cy='6' r='4.5'/%3E%3Cpath d='M10 10l3 3'/%3E%3C/svg%3E") no-repeat 11px center; font-size: 13px; color: var(--text); outline: none; }
.topsearch input:focus { border-color: #089c97; box-shadow: 0 0 0 3px rgba(10,186,181, .12); }
.ric-voce { display: flex; justify-content: space-between; gap: 12px; padding: 9px 4px; border-top: 1px solid #e4eeee; color: var(--text); text-decoration: none; font-size: 14px; }
.ric-voce:first-of-type { border-top: 0; }
.ric-voce small { color: #7b8584; white-space: nowrap; }
.ric-voce:hover { background: #f6fbfb; }
@media (max-width: 700px) { .topsearch { flex: 1 1 100px; margin-left: 8px; } }

.obq-titolo { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0 12px; }
.obq-titolo h2 { margin: 0; font-size: 18px; }

/* Impianti di sollevamento */
.sol-proposta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
.sol-proposta > div { flex: 1 1 240px; background: #f2f7f7; border-radius: 12px; padding: 10px 14px; }
.sol-proposta .hint { display: block; font-size: 11.5px; margin-bottom: 2px; }
.sol-proposta strong { font-size: 15px; color: #2d4a49; }

.sol-ordina { margin: -4px 0 14px; font-size: 13px; color: #66706f; }
.sol-ordina select { margin-left: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(10,186,181,.2); background: #fff; font-size: 13px; }

.sol-imp-riga { border: 1px solid #e4eeee; border-radius: 12px; padding: 12px 14px; margin-top: 12px; }
.sol-imp-dubbia { border-color: #f3b4bd; background: #fff7f8; }

/* Icone a linea (sostituiscono le emoji) */
.ico { width: 1em; height: 1em; display: block; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.tile .icon { line-height: 0; }
.tile-app .icon { font-size: 24px; color: #2d4a49; margin-bottom: 8px; }
.tile-grid-app .tile-app:nth-child(n+4) .icon { color: #1d3a39; }
.alert-pill .alert-ico { font-size: 20px; color: var(--green-text); }
.alert-pill.rosso .alert-ico { color: var(--red-text); }
.tool-chip span { display: inline-flex; font-size: 16px; color: #089c97; }

/* Palette uniforme: verde tiffany, grigio, bianco */
.tile-grid-app .tile-app:nth-child(n) { background: linear-gradient(135deg, #ffffff 0%, #d6f0ee 100%); }
.tile-grid-app .tile-app:nth-child(n) .titolo { color: #2b3a3a; }
.tile-grid-app .tile-app:nth-child(n) .sotto { color: #6e7878; }
.tile-grid-app .tile-app:nth-child(n) .icon { color: #0a9d98; }

/* ---------- Home per capitoli ISO 9001 ---------- */
.cap-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; margin-bottom: 8px; }
.cap-card { background: #fff; border: 1px solid rgba(10,186,181,.16); border-radius: 20px; padding: 18px 12px 12px; box-shadow: 0 2px 10px rgba(0,0,0,.04); display: flex; flex-direction: column; gap: 2px; }
.cap-head { display: flex; align-items: center; gap: 14px; padding: 0 10px 10px; }
.cap-head h2 { margin: 0; font-size: 16.5px; letter-spacing: -.01em; color: #2b3a3a; }
.cap-head p { margin: 2px 0 0; font-size: 12px; color: #5d6969; }
.cap-num { width: 44px; height: 44px; flex: none; border-radius: 14px; background: #e3f6f5; color: #067873; display: flex; align-items: center; justify-content: center; font-size: 21px; font-weight: 700; }
.cap-num-grigio { background: #fff; color: #5d6969; font-size: 22px; }
.cap-sistema { background: #eef2f2; border-style: dashed; border-color: rgba(10,186,181,.4); box-shadow: none; }
.cap-row { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px; color: #2b3a3a; font-size: 14px; font-weight: 500; text-decoration: none; }
.cap-row:hover { background: #e3f6f5; }
.cap-ico { display: inline-flex; font-size: 20px; color: #067873; }
.cap-lbl { flex: 1; min-width: 0; }
.cap-badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--red-bg); color: var(--red-text); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.cap-go { width: 16px; height: 16px; color: #9aa6a6; }

/* ---------- Tema Mercedes F1: nero, argento, verde petronas (sobrio) ---------- */
:root { --petronas: #00d2be; --nero: #0b1010; --argento: #b9c4c4; }
.topnav { background: var(--nero); border-bottom: 2px solid var(--petronas); box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 0 18px; }
.topnav .brand { color: #fff; }
.topnav nav { gap: 1px; }
.topnav nav a { color: var(--argento); font-size: 13px; padding: 7px 10px; }
.topnav nav a:hover, .topnav nav a.nav-verde:hover:not(.attivo) { background: rgba(255,255,255,.1); color: #fff; box-shadow: none; transform: none; }
.topnav nav a.attivo { background: var(--petronas); color: #06201e; box-shadow: none; font-weight: 600; }
.topnav .nav-divider { background: rgba(255,255,255,.18); margin: 0 6px; }
.topnav nav a.utente-chip, .topnav nav a.utente-chip:hover { background: rgba(255,255,255,.08); padding: 3px 12px 3px 4px; }
.topnav nav a.utente-chip .nome { color: #fff; max-width: 110px; font-size: 13px; }
.topnav .utente-chip .avatar { background: var(--petronas); color: #06201e; }
.topnav .logout-link { color: var(--argento) !important; }
.topnav .logout-link:hover { background: rgba(255,255,255,.1) !important; color: #fff !important; }
.topsearch { margin-left: 10px; flex: 0 1 150px; }
.topsearch input { background-color: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); color: #fff; }
.topsearch input::placeholder { color: #8d9a9a; }
.topsearch input:focus { border-color: var(--petronas); box-shadow: 0 0 0 3px rgba(0,210,190,.18); }
.sub-motto { color: #067873; font-weight: 700; letter-spacing: .04em; }
.cap-num { background: var(--nero); color: var(--petronas); }
.cap-num-grigio { background: #fff; color: #5d6969; }
.cap-card { border-color: #dde3e3; border-top: 3px solid var(--petronas); }
.cap-sistema { border-top: 3px solid #b9c4c4; }
.cap-row:hover { background: #eef3f3; }
.cap-ico { color: #067873; }
/* La barra non deve mai uscire dalla finestra */
.topnav { max-width: 100vw; box-sizing: border-box; gap: 10px; }
.topnav .brand { flex: none; }
.topnav nav { min-width: 0; flex-shrink: 1; }
@media (max-width: 1400px) { .topnav nav a.utente-chip .nome { display: none; } .topnav nav a.utente-chip { padding: 3px; } }
@media (max-width: 1200px) { .topnav nav a.nav-verde { display: none; } .topnav .nav-divider { display: none; } }
@media (max-width: 700px) { .topsearch { display: none; } }
body { overflow-x: clip; }
.topnav { padding-left: 16px; padding-right: 16px; }
.topnav nav a { white-space: nowrap; }
@media (max-width: 1500px) { .topnav nav a.utente-chip .nome { display: none; } .topnav nav a.utente-chip { padding: 3px; } .topsearch { flex-basis: 130px; } }
@media (max-width: 1320px) { .topnav nav a.nav-verde { display: none; } .topnav .nav-divider { display: none; } }
