/* GymTrack — stile mobile-first. Tema chiaro di default, tema scuro attivabile
   dal profilo (classe .theme-dark su <html>, preferenza salvata sul dispositivo). */
:root {
  --bg: #f3f5f9;
  --bg-2: #ffffff;
  --bg-3: #eef1f6;
  --line: #dbe1ec;
  --text: #1a2233;
  --muted: #5b6578;
  --accent: #2563eb;
  --accent-2: #1d4ed8;
  --ok: #059669;
  --warn: #b45309;
  --err: #dc2626;
  --radius: 14px;
  --tabbar-h: 64px;
}

html.theme-dark {
  --bg: #10131a;
  --bg-2: #181c26;
  --bg-3: #222837;
  --line: #2e3548;
  --text: #eef1f7;
  --muted: #9aa3b5;
  --accent: #4f8cff;
  --accent-2: #2563eb;
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overscroll-behavior-y: none;
}

#app {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 16px calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom, 0px));
}

.hidden { display: none !important; }

/* ------- splash ------- */
.boot-splash {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 70vh; gap: 12px; font-size: 22px; font-weight: 700; color: var(--muted);
}
.boot-logo { font-size: 56px; }

/* ------- intestazioni ------- */
.page-head { margin: 8px 0 18px; }
.page-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.3px; }
.page-head .sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.profile-btn {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: var(--bg-3); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; text-decoration: none;
}
.profile-btn:active { border-color: var(--accent); }
/* bottone profilo flottante: fisso in alto a destra su ogni pagina del cliente */
.profile-fab {
  position: fixed; z-index: 70;
  top: calc(env(safe-area-inset-top, 0px) + 12px); right: 14px;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg-3); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; text-decoration: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .14);
}
.profile-fab:active { border-color: var(--accent); }

/* ------- card ------- */
.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
}
.card h2 { font-size: 16px; font-weight: 700; margin-bottom: 10px; }
.card h3 { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.card .muted { color: var(--muted); font-size: 13px; }
.card-tap { cursor: pointer; transition: border-color .15s; }
.card-tap:active { border-color: var(--accent); }

/* ------- pulsanti ------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent-2); color: #fff; border: none; border-radius: 12px;
  padding: 13px 18px; font-size: 15px; font-weight: 600; cursor: pointer;
  min-height: 48px; width: 100%;
  transition: filter .15s;
}
.btn:active { filter: brightness(1.2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.secondary { background: var(--bg-3); color: var(--text); border: 1px solid var(--line); }
.btn.ghost { background: transparent; color: var(--accent); border: none; }
.btn.danger { background: transparent; color: var(--err); border: 1px solid var(--err); }
.btn.small { min-height: 36px; padding: 7px 12px; font-size: 13px; width: auto; }
.btn-row { display: flex; gap: 10px; margin-top: 12px; }
.btn-row .btn { flex: 1; }

/* ------- form ------- */
label.field { display: block; margin-bottom: 12px; }
label.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
/* hint annidato nella label (es. "(facoltativa)"): inline, così resta sulla stessa riga */
label.field span span { display: inline; margin-bottom: 0; }
input, select, textarea {
  width: 100%; background: var(--bg-3); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; font-size: 16px; font-family: inherit;
  min-height: 48px;
}
textarea { min-height: 76px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
input[type="number"] { text-align: center; font-weight: 700; }
/* Safari iOS dà agli input data una larghezza intrinseca nativa e ignora
   width:100% (il campo sborda a destra): appearance:none lo riporta in riga */
input[type="date"], input[type="time"], input[type="datetime-local"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* griglie di campi nei form/modali: min-width:0 evita che i controlli con
   larghezza intrinseca (es. input date su iOS) sbordino dalla cella; su
   mobile le coppie di campi si impilano in colonna singola */
.form-2col, .form-3col { display: grid; gap: 10px; }
.form-2col { grid-template-columns: 1fr 1fr; }
.form-3col { grid-template-columns: 1fr 1fr 1fr; }
.form-2col > *, .form-3col > * { min-width: 0; }
.form-2col input, .form-2col select, .form-3col input, .form-3col select { min-width: 0; }
@media (max-width: 480px) {
  .form-2col { grid-template-columns: 1fr; gap: 0; }
}

/* banner "installa come app" (PWA) */
.install-banner {
  position: fixed; left: 10px; right: 10px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 60; display: flex; align-items: center; gap: 10px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 12px; font-size: 13.5px;
  box-shadow: 0 6px 24px rgba(15, 23, 42, .2);
}
.install-banner .grow { flex: 1; }
.install-banner .btn.small { flex: 0 0 auto; width: auto; }
.install-banner.above-tabbar { bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom, 0px)); }
.install-x { background: none; border: 0; color: var(--muted); font-size: 16px; cursor: pointer; padding: 4px; flex: 0 0 auto; }

/* toggle mostra/nascondi password (login e prima configurazione) */
.pw-wrap { display: block; position: relative; margin: 0; }
.pw-wrap input { padding-right: 48px; }
.pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; cursor: pointer;
  font-size: 19px; line-height: 1; padding: 8px; opacity: .6;
}
.pw-toggle:hover, .pw-toggle:focus { opacity: 1; }

/* ------- tabbar ------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; justify-content: space-around;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600;
}
.tabbar a .ico { font-size: 21px; line-height: 1; }
.tabbar a.active { color: var(--accent); }

/* ------- chip / badge ------- */
.chip {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  background: var(--bg-3); border: 1px solid var(--line);
  font-size: 12px; font-weight: 600; color: var(--muted);
}
.chip.on { background: rgba(37, 99, 235, .10); border-color: var(--accent); color: var(--accent); }
.chip-ok { background: rgba(5, 150, 105, .10); border-color: var(--ok); color: var(--ok); }
.chip-warn { background: rgba(180, 83, 9, .10); border-color: var(--warn); color: var(--warn); }
.chip-err { background: rgba(220, 38, 38, .08); border-color: var(--err); color: var(--err); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
/* filtro periodo "Personalizzato": i due campi data Dal/Al affiancati */
.date-range { display: flex; gap: 10px; margin: 4px 0 10px; }
.date-range .field { flex: 1; margin: 0; }
.badge-ok { color: var(--ok); font-weight: 700; }
.badge-warn { color: var(--warn); font-weight: 700; }

/* ------- esercizio nella seduta ------- */
.ex-row { display: flex; align-items: center; gap: 12px; }
.ex-row .ex-info { flex: 1; min-width: 0; }
.ex-row .ex-name { font-weight: 700; font-size: 15px; }
.ex-row .ex-meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.ex-thumb {
  width: 46px; height: 46px; border-radius: 10px; background: var(--bg-3);
  display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0;
  overflow: hidden;
}
.ex-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ex-done { color: var(--ok); font-size: 20px; }
.ex-skip { color: var(--warn); font-size: 22px; font-weight: 700; }

/* ------- griglia set ------- */
.set-grid { display: grid; grid-template-columns: 32px 1.15fr 1fr 28px; gap: 6px; align-items: center; margin-top: 10px; }
.set-grid .head { font-size: 12px; color: var(--muted); font-weight: 700; text-align: center; }
.set-num {
  width: 30px; height: 30px; margin: 0 auto; border-radius: 50%;
  background: var(--bg-3); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.set-del { background: none; border: none; color: var(--muted); font-size: 20px; cursor: pointer; min-height: 44px; }

/* ------- stepper grandi per peso/rip ------- */
.stepper { display: flex; align-items: stretch; gap: 4px; }
.stepper button {
  width: 36px; flex-shrink: 0; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-3);
  color: var(--text); font-size: 18px; font-weight: 700; cursor: pointer; min-height: 48px;
}
.stepper input { flex: 1; min-width: 0; padding: 8px 2px; }

/* ------- statistiche ------- */
.stat-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.stat-tile { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: 0 1px 3px rgba(15, 23, 42, .06); }
.stat-tile .val { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.stat-tile .lbl { color: var(--muted); font-size: 12px; margin-top: 4px; font-weight: 600; }
.stat-tile .delta { font-size: 12px; font-weight: 700; margin-top: 2px; }

.chart-box { width: 100%; overflow-x: auto; }
.chart-box svg { display: block; width: 100%; height: auto; }

/* ------- percentile bar ------- */
.pct-row { margin-bottom: 16px; }
.pct-row .pct-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.pct-row .pct-head b { font-size: 13px; }
.pct-track { height: 10px; border-radius: 999px; background: var(--bg-3); position: relative; overflow: hidden; }
.pct-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.score-ring { display: flex; flex-direction: column; align-items: center; padding: 10px 0 4px; }
.score-ring .num { font-size: 44px; font-weight: 800; color: var(--accent); }
.score-ring .cap { color: var(--muted); font-size: 13px; }

/* ------- liste ------- */
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 13px 4px;
  border-bottom: 1px solid var(--line); cursor: pointer;
}
.list-item:last-child { border-bottom: none; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 700; font-size: 15px; }
.list-item .sub { color: var(--muted); font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .arrow { color: var(--muted); }

/* ------- modale ------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 18px 18px 0 0; width: 100%; max-width: 760px;
  max-height: 88vh; overflow-y: auto; padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  animation: slideup .2s ease-out;
}
@keyframes slideup { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h2 { font-size: 18px; margin-bottom: 14px; }
@media (min-width: 700px) {
  .modal-backdrop { align-items: center; }
  .modal { border-radius: 18px; max-width: 560px; }
}

/* ------- toast ------- */
.toast-host { position: fixed; bottom: calc(var(--tabbar-h) + 16px); left: 0; right: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  background: var(--bg-3); border: 1px solid var(--line); color: var(--text);
  padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .18);
  animation: slideup .2s ease-out;
  max-width: 92%;
}
.toast.ok { border-color: var(--ok); }
.toast.err { border-color: var(--err); }

/* ------- login ------- */
.login-wrap { max-width: 380px; margin: 8vh auto 0; }
.login-logo { text-align: center; font-size: 54px; margin-bottom: 6px; }
.login-title { text-align: center; font-size: 26px; font-weight: 800; margin-bottom: 4px; }
.login-sub { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 26px; }
.demo-hint { margin-top: 18px; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.demo-hint code { background: var(--bg-3); padding: 2px 6px; border-radius: 6px; cursor: pointer; }

/* ------- video embed ------- */
.video-box { border-radius: 12px; overflow: hidden; margin: 10px 0; background: #000; }
.video-box iframe, .video-box video { width: 100%; aspect-ratio: 16 / 9; border: none; display: block; }
.ex-img { width: 100%; border-radius: 12px; margin: 10px 0; }

/* ------- offline banner ------- */
.offline-banner {
  position: sticky; top: 0; z-index: 60;
  background: rgba(180, 83, 9, .08); border: 1px solid var(--warn); color: var(--warn);
  border-radius: 10px; padding: 9px 14px; font-size: 13px; font-weight: 600;
  margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}

/* ------- tabella admin / desktop ------- */
table.simple { width: 100%; border-collapse: collapse; font-size: 14px; }
table.simple th, table.simple td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
table.simple th { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }

/* tabelle larghe (Utenti, Pagamenti): su mobile ogni riga diventa un blocco
   "etichetta → valore" (niente scorrimento orizzontale). Le celle portano
   l'etichetta in data-l; .t-main è l'intestazione della riga, .t-actions i
   bottoni, .sm-hide le celle vuote da nascondere solo su mobile. */
@media (max-width: 640px) {
  table.simple.stack, table.simple.stack tbody { display: block; }
  table.simple.stack thead { display: none; }
  table.simple.stack tr { display: flex; flex-direction: column; padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.simple.stack tr:last-child { border-bottom: 0; }
  table.simple.stack td { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 3px 0; border: 0; }
  table.simple.stack td[data-l]::before {
    content: attr(data-l); flex: 0 0 auto;
    color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase;
  }
  table.simple.stack td[data-l] > span { text-align: right; }
  table.simple.stack td.t-main { display: block; order: -1; padding: 0 0 5px; }
  table.simple.stack td.t-actions { justify-content: flex-end; padding-top: 7px; }
  table.simple.stack td.sm-hide { display: none; }
}

/* layout più arioso su desktop */
@media (min-width: 900px) {
  #app { max-width: 980px; }
  .stat-tiles { grid-template-columns: repeat(4, 1fr); }
}

/* ------- banner di errore (es. abbonamento scaduto) ------- */
.offline-banner.banner-err { border-color: var(--err); color: var(--err); background: rgba(220, 38, 38, .07); }

/* ------- aggiustamenti per il tema scuro (colori non coperti dalle variabili) ------- */
html.theme-dark .tabbar { background: rgba(16, 19, 26, .92); }
html.theme-dark .modal-backdrop { background: rgba(0, 0, 0, .6); }
html.theme-dark .toast { box-shadow: 0 8px 24px rgba(0, 0, 0, .4); }
html.theme-dark .card, html.theme-dark .stat-tile { box-shadow: none; }
html.theme-dark .chip.on { background: rgba(79, 140, 255, .15); }
html.theme-dark .chip-ok { background: rgba(52, 211, 153, .12); }
html.theme-dark .chip-warn { background: rgba(251, 191, 36, .12); }
html.theme-dark .chip-err { background: rgba(248, 113, 113, .12); }
html.theme-dark .offline-banner { background: rgba(251, 191, 36, .12); }
html.theme-dark .offline-banner.banner-err { background: rgba(248, 113, 113, .10); }

/* ------- editor scheda: giorni a fisarmonica + barra azioni fissa ------- */
.pe-modal { padding-bottom: 0; } /* la barra azioni sticky gestisce lo spazio in fondo */

.pe-day {
  border: 1px solid var(--line); border-radius: 12px;
  margin-bottom: 10px; overflow: hidden; background: var(--bg-2);
}
.pe-day-head {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 13px 14px; min-height: 52px;
  background: var(--bg-3); border: none; cursor: pointer;
  font: inherit; color: var(--text); text-align: left;
}
.pe-day-head:active { filter: brightness(1.04); }
.pe-chev { color: var(--muted); font-size: 13px; flex-shrink: 0; transition: transform .18s ease; }
.pe-day.open .pe-chev { transform: rotate(90deg); }
.pe-day-title { font-weight: 800; font-size: 15px; letter-spacing: .2px; }
.pe-day-count { margin-left: auto; color: var(--muted); font-size: 13px; font-weight: 600; }
.pe-day-body { display: none; padding: 2px 14px 12px; }
.pe-day.open .pe-day-body { display: block; }
.pe-day-body > .list-item:last-of-type { border-bottom: none; }
.pe-day-add { margin-top: 8px; }

.pe-actions {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; gap: 10px;
  margin: 16px -16px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--bg-2); border-top: 1px solid var(--line);
}
.pe-actions .btn { flex: 1; margin-top: 0; }

/* ------- ricerca esercizio nell'editor (lista filtrata + crea al volo) ------- */
.ie-groups { margin: 0 0 10px; } /* .chip-row va già a capo (flex-wrap): niente scroll orizzontale */
.ie-groups:empty { display: none; }
.ie-groups .chip { cursor: pointer; }
.ie-results {
  max-height: 260px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg-3);
}
.ie-opt {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-bottom: 1px solid var(--line); cursor: pointer;
}
.ie-opt:last-child { border-bottom: none; }
.ie-opt .grow { flex: 1; min-width: 0; }
.ie-opt .title { font-weight: 700; font-size: 14px; }
.ie-opt .sub { color: var(--muted); font-size: 12px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ie-opt.sel { background: rgba(37, 99, 235, .10); }
.ie-opt:active { background: rgba(37, 99, 235, .06); }
.ie-check { color: var(--accent); font-weight: 800; font-size: 18px; flex-shrink: 0; }
.ie-create {
  display: block; width: 100%; text-align: left; padding: 12px;
  background: transparent; border: none; border-top: 1px dashed var(--line);
  color: var(--accent); font-weight: 700; font-size: 14px; cursor: pointer;
}
.ie-create:active { filter: brightness(1.2); }
html.theme-dark .ie-opt.sel { background: rgba(79, 140, 255, .15); }
html.theme-dark .ie-opt:active { background: rgba(79, 140, 255, .08); }

/* etichetta "super serie" (esercizi accoppiati) */
.ss-tag {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .2px;
  color: var(--accent); background: rgba(37, 99, 235, .10);
  border: 1px solid var(--accent); border-radius: 999px;
  padding: 1px 8px; vertical-align: middle; margin-left: 4px; white-space: nowrap;
}
html.theme-dark .ss-tag { background: rgba(79, 140, 255, .15); }

/* righe degli esercizi aggiuntivi nel builder super serie (editor) */
.ss-row { display: flex; align-items: center; gap: 8px; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.ss-row:last-of-type { border-bottom: none; }
.ss-row .ss-idx { flex-shrink: 0; width: 26px; font-weight: 800; color: var(--accent); font-size: 13px; }
.ss-row .grow { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-row .ss-reps { width: 62px; flex-shrink: 0; text-align: center; min-height: 40px; padding: 6px; font-size: 15px; }

/* ------- home admin: tile cliccabili + filtri registro pagamenti ------- */
.stat-tile-tap { cursor: pointer; transition: border-color .15s; }
.stat-tile-tap:hover, .stat-tile-tap:active { border-color: var(--accent); }
.stat-tile-tap .tap-arrow { color: var(--accent); font-weight: 800; }
.pay-filter { margin: 0 0 8px; }
.pay-filter .chip { cursor: pointer; }

/* elenco clienti istruttore: ordinamento (Recenti/A→Z) + indice alfabetico */
.sort-chips .chip, .az-bar .chip { cursor: pointer; }
.az-bar { gap: 6px; margin: 0 0 12px; }
.az-bar .chip { min-width: 32px; text-align: center; }

/* scheda per più clienti: sezione "Assegna a" + lista clienti con checkbox */
.pe-assign { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 10px 0 4px; }
.pick-list { border: 1px solid var(--line); border-radius: 10px; max-height: 220px; overflow: auto; }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.pick-row:last-child { border-bottom: none; }
.pick-row input { width: 20px; height: 20px; min-height: auto; }
/* tag "gruppo" del cliente (accanto al nome nell'elenco e nel picker) */
.cli-grp { display: inline-block; font-size: 10px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--bg-3); border: 1px solid var(--line); color: var(--muted); vertical-align: middle; margin-left: 4px; white-space: nowrap; }

/* ------- selezione multipla nell'elenco esercizi ------- */
.list-item.sel-on { background: rgba(37, 99, 235, .08); }
html.theme-dark .list-item.sel-on { background: rgba(79, 140, 255, .12); }
.bulk-bar {
  position: fixed; left: 0; right: 0; z-index: 80;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  max-width: 760px; margin: 0 auto;
  display: flex; gap: 10px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--bg-2); border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(15, 23, 42, .12);
}
.bulk-bar .btn { flex: 1; margin: 0; }
html.theme-dark .bulk-bar { box-shadow: 0 -6px 20px rgba(0, 0, 0, .4); }

/* ------- timer di recupero ------- */
.rt-quick {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--bg-3); color: var(--accent);
  font-size: 19px; cursor: pointer; line-height: 1;
}
.rt-quick:active { border-color: var(--accent); }
.rest-timer {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + 14px + env(safe-area-inset-bottom, 0px));
  z-index: 150; display: flex; align-items: center; gap: 12px;
  background: var(--bg-2); border: 2px solid var(--accent);
  border-radius: 999px; padding: 8px 10px 8px 20px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .28); max-width: 94%;
}
.rest-timer .rt-time {
  font-size: 26px; font-weight: 800; color: var(--accent);
  font-variant-numeric: tabular-nums; min-width: 66px; letter-spacing: .5px;
}
.rest-timer .rt-controls { display: flex; gap: 6px; }
.rest-timer .rt-btn {
  border: 1px solid var(--line); background: var(--bg-3); color: var(--text);
  border-radius: 10px; min-width: 44px; height: 42px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.rest-timer .rt-btn:active { filter: brightness(1.15); }
.rest-timer .rt-skip { color: var(--err); }
.rest-timer.rt-done { border-color: var(--ok); animation: rt-flash .5s ease-in-out 3; }
.rest-timer.rt-done .rt-time { color: var(--ok); }
@keyframes rt-flash {
  0%, 100% { box-shadow: 0 10px 30px rgba(5, 150, 105, .3); }
  50% { box-shadow: 0 0 0 5px rgba(5, 150, 105, .4); }
}
