/* ProdsLab Admin — layout. Colori, vetro e componenti base arrivano da theme.css */
.wrap { max-width: 1180px; margin: 0 auto; padding: 22px 18px 40px; display: flex; flex-direction: column; gap: 18px; }
.hdr-right { display: flex; align-items: center; gap: 12px; }
.user { font-weight: 800; font-size: var(--fs-sm); }
.live { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); animation: pulse 2s infinite; }
.live.off i { background: var(--danger, #f87171); box-shadow: none; animation: none; }
@keyframes pulse { 50% { opacity: .35; } }

/* Server: 5 indicatori in riga */
.server { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.meter { padding: 14px 16px; border-radius: var(--radius-lg, 18px); background: linear-gradient(180deg, var(--glass-2), var(--glass)); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.meter .lbl { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.meter .lbl .ic { font-size: 14px; color: var(--accent); width: 16px; text-align: center; }
.meter b { font-size: 1.35rem; font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meter small { color: var(--muted); font-size: var(--fs-xs); }
.meter .btn { margin-top: 4px; align-self: flex-start; }
.bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); transition: width .5s; }
.bar.warn i { background: #f59e0b; } .bar.bad i { background: var(--danger, #f87171); }

.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin-top: 6px; }
.sec-head h2 { margin: 0; font-size: 1.3rem; }

/* Siti: una scheda per sito */
.siti { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.sito { --c: var(--accent); position: relative; padding: 18px; border-radius: var(--radius-lg, 18px); overflow: hidden;
  background: linear-gradient(180deg, var(--glass-2), var(--glass)); border: 1px solid var(--line); box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 14px; transition: border-color var(--dur, .2s); }
.sito::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--c); }
.sito.is-off { border-color: color-mix(in srgb, var(--danger, #f87171) 45%, transparent); }
.sito-top { display: grid; grid-template-columns: 52px 1fr auto; gap: 14px; align-items: center; }
.sito-ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 26px;
  background: color-mix(in srgb, var(--c) 16%, transparent); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }
.sito-ic i { color: var(--c); font-size: 24px; }
.sito h3 { margin: 0; font-size: 1.15rem; }
.sito a.dom { font-size: var(--fs-xs); color: var(--muted); }
.sito a.dom:hover { color: var(--c); }
.stato { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 900; white-space: nowrap; }
.stato i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.stato.on { color: #22c55e; background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.35); }
.stato.on i { box-shadow: 0 0 8px #22c55e; }
.stato.off { color: var(--danger, #f87171); background: rgba(248,113,113,.12); border: 1px solid rgba(248,113,113,.35); }
.stato.mid { color: #f59e0b; background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.35); }
.fatti { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.fatto { padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.035); border: 1px solid var(--line); min-width: 0; }
.fatto span { display: block; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.fatto b { display: block; font-size: .95rem; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fatto b.ok { color: #22c55e; } .fatto b.ko { color: #f59e0b; }
.azioni { display: flex; gap: 8px; flex-wrap: wrap; }
.azioni .btn { flex: 1 1 auto; }
.btn.is-busy { opacity: .6; pointer-events: none; }
.btn--danger { background: rgba(248,113,113,.14); color: var(--danger, #f87171); border: 1px solid rgba(248,113,113,.4); }
.btn--danger.is-confirm { background: var(--danger, #f87171); color: #2a0608; }

.logbox { display: flex; flex-direction: column; gap: 10px; }
.log-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.log-head h3 { margin: 0; }
.log-btns { display: flex; gap: 8px; }
#log { margin: 0; max-height: 420px; overflow: auto; padding: 12px; border-radius: 12px; background: rgba(0,0,0,.35); border: 1px solid var(--line);
  font: 12px/1.5 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-word; color: #cbd5e1; }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 50; padding: 10px 18px; border-radius: 999px;
  background: var(--glass-strong); border: 1px solid var(--line-strong); font-weight: 700; font-size: var(--fs-sm); box-shadow: var(--shadow); }
.toast.bad { border-color: var(--danger, #f87171); color: var(--danger, #f87171); }

/* Login */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 14px; }
.login-head { display: flex; gap: 14px; align-items: center; }
.login-head h1 { margin: 0; font-size: 1.4rem; }
.login-head .accent { color: var(--accent); }
.login-head p, .login-note { margin: 0; color: var(--muted); font-size: var(--fs-sm); }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: .82rem; font-weight: 700; color: var(--muted); }
.login-card input { width: 100%; }
.form-err { margin: 0; color: var(--danger, #f87171); font-weight: 700; font-size: .9rem; }

@media (max-width: 900px) {
  .server { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .siti { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .fatti { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .live { display: none; }
}

/* Intestazione comune dell'area admin: logo | schede (Siti · Laboratorio · Risultati) | in diretta, utente, Esci */
.topbar--admin { flex-wrap: wrap; }
.admin-nav { flex: 1; justify-content: center; }
.admin-nav a i { margin-right: 4px; font-size: .9em; }
.admin-nav a.active { color: var(--text); background: var(--accent-weak); }
@media (max-width: 900px) {
  .admin-nav { order: 3; flex-basis: 100%; justify-content: space-between; gap: 4px; }
  .admin-nav a { flex: 1; text-align: center; padding: 8px 6px; }
  .topbar--admin .live { display: none; }
}
