/* Power Pratiche – area clienti (mobile first) */
.pp-app {
  --ink: #16242e; --muted: #5c6b77; --line: #dde5ea; --bg: #f5f8fa;
  --blue: #1f5f8b; --green: #2e7d4f; --amber: #9a5b00; --red: #b3261e;
  color: var(--ink); background: var(--bg); max-width: 620px; margin: 0 auto;
  border-radius: 14px; overflow: hidden; font-size: 16px; line-height: 1.45;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.pp-app * { box-sizing: border-box; }
.pp-app h2 { font-size: 1.25rem; margin: 4px 0 10px; }
.pp-app h3 { font-size: 1rem; margin: 18px 0 8px; }
.pp-app small { color: var(--muted); }

.pp-topbar { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--blue); color: #fff; padding: 14px 16px; }
.pp-topbar small { color: #cfe2ef; display: block; }
.pp-topbar .pp-link { color: #fff; text-decoration: underline; font-size: .9rem; }

.pp-body { padding: 14px 14px 84px; }
.pp-lead { color: var(--muted); margin: 0 0 12px; }
.pp-empty { color: var(--muted); }

.pp-item { display: block; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 14px; margin-bottom: 10px; font: inherit; color: inherit; cursor: pointer; }
.pp-item:active { background: #eef4f8; }
.pp-item-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pp-item strong { display: block; }
.pp-item small { display: block; }

.pp-tag { font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: #eef1f3; white-space: nowrap; }
.pp-s-richiesta { background: #f0e6ff; color: #5b2d91; }
.pp-s-attesa_doc { background: #fff1d6; color: var(--amber); }
.pp-s-lavorazione, .pp-s-appuntamento, .pp-s-attesa_esito { background: #e3eef8; color: var(--blue); }
.pp-s-pronta, .pp-s-completata { background: #e3f3e8; color: var(--green); }
.pp-s-annullata { background: #f6e3e3; color: var(--red); }

.pp-bar { height: 6px; background: #e7edf1; border-radius: 99px; margin: 10px 0 6px; overflow: hidden; }
.pp-bar span { display: block; height: 100%; background: var(--green); }
.pp-appt { color: var(--blue) !important; font-weight: 600; }

.pp-back { background: none; border: 0; color: var(--blue); font: inherit; padding: 0 0 10px; cursor: pointer; }
.pp-msg { background: #fff8e1; border-left: 4px solid #f0b429; border-radius: 6px; padding: 10px 12px; margin: 12px 0; }
.pp-msg p { margin: 4px 0 0; }

.pp-doc { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.pp-doc.is-ok { border-color: #bfe3cc; background: #f4fbf6; }
.pp-doc-mark { display: inline-block; width: 1.4em; font-weight: 700; color: var(--amber); }
.pp-doc.is-ok .pp-doc-mark { color: var(--green); }
.pp-doc-actions { display: flex; gap: 6px; }

.pp-file { display: flex; justify-content: space-between; gap: 10px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 6px; text-decoration: none; color: var(--blue); }

.pp-btn { display: block; width: 100%; background: var(--blue); color: #fff; border: 1px solid var(--blue);
  border-radius: 10px; padding: 13px 16px; font: inherit; font-weight: 600; text-align: center; margin: 10px 0 0; cursor: pointer; text-decoration: none; }
.pp-btn:active { filter: brightness(.92); }
.pp-btn-ghost { background: #fff; color: var(--blue); }
.pp-btn-sm { width: auto; padding: 8px 12px; margin: 0; font-size: .9rem; }

.pp-label { display: block; font-weight: 600; font-size: .92rem; margin: 12px 0 0; }
.pp-input { display: block; width: 100%; margin-top: 4px; padding: 12px; border: 1px solid var(--line);
  border-radius: 10px; font: inherit; font-weight: 400; background: #fff; }
.pp-consent { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0; font-size: .95rem; }
.pp-consent input { margin-top: 4px; width: 20px; height: 20px; }
.pp-list { margin: 0 0 8px; padding-left: 20px; }
.pp-cat { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; padding: 4px 10px; }
.pp-cat summary { padding: 10px 4px; font-weight: 700; cursor: pointer; }
.pp-cat .pp-item { border: 0; border-top: 1px solid var(--line); border-radius: 0; margin: 0; padding: 12px 4px; }

.pp-appoint { margin: 14px 0; }
.pp-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; }
.pp-chip { background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 10px 14px; font: inherit; cursor: pointer; }
.pp-chip.is-on { background: var(--blue); color: #fff; border-color: var(--blue); }
.pp-done { text-align: center; padding: 20px 0; }

.pp-nav { position: sticky; bottom: 0; display: flex; background: #fff; border-top: 1px solid var(--line); }
.pp-nav-btn { flex: 1; background: none; border: 0; padding: 14px 4px calc(14px + env(safe-area-inset-bottom, 0px));
  font: inherit; color: var(--muted); cursor: pointer; }
.pp-nav-btn.is-on { color: var(--blue); font-weight: 700; box-shadow: inset 0 3px 0 var(--blue); }

.pp-toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 84px; z-index: 9999;
  background: #16242e; color: #fff; padding: 12px 18px; border-radius: 10px; max-width: 90vw; }
.pp-toast.is-err { background: var(--red); }
.pp-busy { position: fixed; inset: 0; z-index: 9998; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.75); font-weight: 600; color: var(--ink); }
.pp-install { position: fixed; right: 14px; bottom: 90px; z-index: 9997; background: var(--green); color: #fff;
  border: 0; border-radius: 99px; padding: 12px 18px; font: inherit; font-weight: 600; box-shadow: 0 4px 12px rgba(0,0,0,.2); }

@media (prefers-color-scheme: dark) {
  .pp-app { --bg: #10181e; --ink: #e8eef2; --line: #2b3942; --muted: #9db0bd; background: var(--bg); }
  .pp-item, .pp-doc, .pp-file, .pp-input, .pp-cat, .pp-chip, .pp-nav, .pp-btn-ghost { background: #172129; color: var(--ink); }
  .pp-doc.is-ok { background: #16261d; border-color: #2f5c40; }
  .pp-msg { background: #2a2418; }
}

.pp-thread-box { margin: 8px 0; }
.pp-m { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 6px; }
.pp-m p { margin: 4px 0 0; }
.pp-m-ufficio { background: #eef4f9; }
.pp-m-fornitore { background: #f3eef9; }
