/* Wave 4 — chrome da prodotto (non sostituisce app.css: lo affina) */
body.app,
body:has(.top) {
  --bg: #f4f6fa;
  --card: #fff;
  --text: #0f172a;
  --muted: #64748b;
  --brand: #0ea5e9;
  --brand-dark: #0369a1;
  --brand-soft: #e0f2fe;
  font-family: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(1200px 400px at 10% -10%, color-mix(in srgb, var(--brand) 12%, transparent), transparent 50%),
    var(--bg);
}

.top {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 0.55rem 1.15rem;
  background: #0b1220;
  border-bottom: 0;
  box-shadow: 0 8px 28px rgba(2, 6, 23, 0.28);
  align-items: center;
}
.top > div:first-child {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 9rem;
}
.top strong { font-size: 1rem; letter-spacing: 0.01em; }
.top strong::before { content: ""; }
.top .brand-mark {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.18);
}
.top .muted { display: none; }
.nav { gap: 0.15rem 0.2rem; flex: 1; }
.nav > a {
  margin-right: 0;
  padding: 0.32rem 0.55rem;
  border-radius: 8px;
  border-bottom: 0;
  font-size: 0.84rem;
  color: #cbd5e1;
}
.nav > a:hover,
.nav > a.is-here {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-bottom: 0;
}
.navsearch { margin-left: auto; }
.navsearch input {
  width: 190px;
  border-radius: 999px;
  border: 1px solid #334155;
  background: #111827;
  color: #e2e8f0;
  padding: 0.38rem 0.75rem;
}
.nav-tog {
  display: none;
  width: 2.2rem;
  height: 2.2rem;
  border: 0;
  background: #1e293b;
  border-radius: 8px;
  cursor: pointer;
  padding: 0.45rem;
  flex-direction: column;
  justify-content: space-between;
}
.nav-tog span { display: block; height: 2px; background: #e2e8f0; border-radius: 2px; }
.nav-more { position: relative; }
.nav-more > summary {
  list-style: none;
  cursor: pointer;
  color: #cbd5e1;
  padding: 0.32rem 0.55rem;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 500;
}
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more > summary:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-more-box {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 220px;
  background: #111827;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 0.4rem;
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
  display: grid;
  z-index: 40;
}
.nav-more-box a {
  margin: 0;
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
  color: #e2e8f0;
  border-bottom: 0;
}
.nav-more-box a:hover { background: #1e293b; color: #fff; }

.main { max-width: 1180px; padding-top: 1.35rem; }
h1 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 1.55rem;
  margin-bottom: 1rem;
}
.card {
  border: 1px solid #e6ebf2;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.04);
}
.stat-card p { font-variant-numeric: tabular-nums; }
table { font-variant-numeric: tabular-nums; }
th { background: #f8fafc; }
.btn {
  border-radius: 9px;
  letter-spacing: 0.01em;
}
.empty {
  text-align: center;
  padding: 1.6rem 1rem 1.4rem;
  color: var(--muted);
}
.empty strong { display: block; color: var(--text); font-size: 1.05rem; margin-bottom: 0.25rem; }
.empty p { margin: 0; }

.punch-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.punch-hero .btn { width: 100%; padding: 1rem; font-size: 1.05rem; }
.punch-hero .btn.out { background: #334155; box-shadow: none; }
.geo-ok { color: #059669; font-size: 0.85rem; }
.geo-bad { color: #b45309; font-size: 0.85rem; }
.pack-bar { height: 8px; background: #e2e8f0; border-radius: 99px; overflow: hidden; }
.pack-bar > i { display: block; height: 100%; background: var(--brand); }
.pack-bar.warn > i { background: #d97706; }
.pack-bar.late > i { background: #dc2626; }

.login-wrap .card { border-radius: 16px; }
.login-wrap .login-brand { letter-spacing: 0.16em; }

@media (max-width: 900px) {
  .nav-tog { display: flex; }
  .top .nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding: 0.4rem 0 0.6rem;
  }
  body.nav-open .top .nav { display: flex; }
  .nav-more-box { position: static; box-shadow: none; border: 0; background: transparent; padding: 0 0 0 0.4rem; }
  .navsearch { margin-left: 0; width: 100%; }
  .navsearch input { width: 100%; }
  .punch-hero { grid-template-columns: 1fr; }
}
