/* Vivi Bitonto — stili pagine applicative (form, dashboard, area socio/admin) */

.app-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--stone); }
.app-main { flex: 1; padding: 40px 0 80px; }

.app-head {
  background: var(--ink); color: #fff; padding: 16px 0;
}
.app-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.app-head a.brand {
  color: #fff; text-decoration: none; font-family: var(--display);
  font-size: 1.45rem; display: inline-flex; align-items: center; gap: 10px;
}
.app-head a.brand img { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; }
.app-head a.brand em { color: var(--gold); font-style: normal; }
.app-head nav a { color: rgba(255,255,255,.8); text-decoration: none; font-size: .9rem; margin-left: 18px; }
.app-head nav a:hover { color: #fff; }

.app-title { font-size: 2rem; margin: 0 0 6px; }
.app-sub { color: var(--muted); margin: 0 0 28px; max-width: 60ch; }

/* ---- card & form ---- */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  padding: 26px; box-shadow: 0 10px 30px rgba(14,38,67,.06);
}
.card + .card { margin-top: 20px; }

.f-grid { display: grid; gap: 16px; }
.f-grid.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .f-grid.two { grid-template-columns: 1fr; } }

label.f-label { display: block; font-size: .85rem; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
label.f-label small { font-weight: 400; color: var(--muted); }

input.f-in, select.f-in, textarea.f-in {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 10px; font: inherit; color: var(--text);
  background: #fff; box-sizing: border-box;
}
input.f-in:focus, select.f-in:focus, textarea.f-in:focus {
  outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold);
}
textarea.f-in { min-height: 90px; resize: vertical; }

.f-check { display: flex; align-items: flex-start; gap: 10px; font-size: .9rem; }
.f-check input { margin-top: 3px; }

.f-actions { display: flex; gap: 12px; align-items: center; margin-top: 8px; flex-wrap: wrap; }

.f-note { font-size: .85rem; color: var(--muted); }
.f-error { color: #b42318; font-size: .9rem; margin-top: 8px; }
.f-ok { color: #1a7f37; font-size: .9rem; margin-top: 8px; }

/* ---- stati / badge ---- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 600; white-space: nowrap;
}
.badge.green { background: #dcf5e3; color: #1a7f37; }
.badge.red { background: #fde3e0; color: #b42318; }
.badge.gold { background: var(--gold-soft); color: #7a5a1c; }
.badge.gray { background: #eceae6; color: #555; }
.badge.blue { background: #e3ecfa; color: var(--ink-2); }

/* ---- tab dashboard ---- */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.tabs button {
  border: none; background: none; padding: 10px 14px; font: inherit; cursor: pointer;
  color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button.on { color: var(--ink); border-bottom-color: var(--gold); font-weight: 600; }
.tabs button:hover { color: var(--ink); }

/* ---- righe liste ---- */
.row-item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.row-item:last-child { border-bottom: none; }
.row-item .grow { flex: 1; min-width: 200px; }
.row-item small { color: var(--muted); display: block; }

.empty-box {
  text-align: center; padding: 40px 20px; color: var(--muted);
  border: 1px dashed var(--line); border-radius: var(--r); background: #faf9f7;
}

.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat {
  background: var(--stone, #F2F1EE); border-radius: var(--r); padding: 16px; text-align: center;
}
.stat b { display: block; font-family: var(--display); font-size: 2rem; font-weight: 500; color: var(--ink); }
.stat span { font-size: .8rem; color: var(--muted); }

.sep { border: none; border-top: 1px solid var(--line); margin: 18px 0; }

/* ---- passaporto ---- */
.pass-hero {
  background: linear-gradient(150deg, var(--ink), var(--ink-2));
  color: #fff; border-radius: var(--r); padding: 28px; text-align: center;
}
.pass-hero .pname { font-family: var(--display); font-size: 1.6rem; margin: 6px 0 2px; }
.pass-hero .pmeta { opacity: .8; font-size: .9rem; }
.pass-qr { background: #fff; padding: 16px; border-radius: 10px; display: inline-block; margin-top: 18px; }
.pass-qr img, .pass-qr canvas { display: block; width: 180px; height: 180px; }
.pass-code { font-family: monospace; font-size: .85rem; letter-spacing: 1px; color: var(--ink); margin-top: 8px; }

.stamp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-top: 16px; }
.stamp {
  border: 2px dashed var(--line); border-radius: 10px;
  padding: 14px 10px; text-align: center; font-size: .85rem; color: var(--muted);
}
.stamp.done { border: 2px solid var(--gold); border-style: solid; color: var(--ink); background: var(--gold-soft); }
.stamp.done .smark { color: #1a7f37; font-weight: 700; }

.stars { display: flex; gap: 4px; }
.stars button { background: none; border: none; cursor: pointer; color: var(--line); font-size: 1.8rem; padding: 2px; }
.stars button.on { color: var(--gold); }

/* ---- notifiche ---- */
.notif-dot { display: inline-block; min-width: 18px; padding: 1px 6px; background: var(--gold); color: var(--ink); border-radius: 999px; font-size: .75rem; font-weight: 700; text-align: center; }

.totem-box {
  background: var(--ink); color: #fff; border-radius: var(--r); padding: 24px;
  text-align: center;
}
.totem-box img { background: #fff; padding: 10px; border-radius: 8px; width: 220px; height: 220px; }
.totem-box code { display: block; margin-top: 12px; font-size: .8rem; word-break: break-all; opacity: .75; }

/* ---- tab scrollabili su mobile ---- */
@media (max-width:900px){
  .tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 8px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
  .tabs button { white-space: nowrap; flex-shrink: 0; }
}
