/* ===== RESET & BASE ===== */
* { box-sizing: border-box; }

body {
  font-family: sans-serif;
  max-width: 700px;
  margin: 0 auto;
  padding: 15px;
  font-size: 16px;
  line-height: 1.5;
  color: #f1f5f9;
  background: url('sfondo.png') no-repeat center center fixed;
  background-size: cover;
  min-height: 100vh;
}

h1, h2, h3 { color: #ffffff; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }

/* ===== CARD ===== */
.card {
  background: rgba(15, 23, 42, 0.80);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 10px;
  padding: 15px;
  margin: 10px 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* ===== ETICHETTE ===== */
label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: #cbd5e1;
  margin-top: 10px;
}

/* ===== INPUT & SELECT ===== */
input,
select {
  width: 100%;
  padding: 12px;
  margin: 5px 0;
  font-size: 16px;
  border-radius: 6px;
  border: 1px solid #475569;
  background: rgba(30, 41, 59, 0.9);
  color: #f1f5f9;
}
input::placeholder { color: #94a3b8; }
input:focus,
select:focus { outline: none; border-color: #3b82f6; }

/* ===== PULSANTI ===== */
button {
  padding: 12px;
  margin: 5px 0;
  font-size: 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  background: #2563eb;
  color: white;
  width: 100%;
}
button:hover { background: #1d4ed8; }
button:disabled { opacity: 0.6; cursor: not-allowed; }

.link {
  color: #60a5fa;
  cursor: pointer;
  text-decoration: underline;
  background: none;
  padding: 0;
  width: auto;
  display: inline;
}
.link:hover { background: none; }

/* ===== UTILITY ===== */
.hidden { display: none; }
.hint { font-size: 12px; color: #94a3b8; margin: 2px 0 6px; }

/* ===== TAB BAR ===== */
.tabbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 10px 0;
  border-bottom: 2px solid rgba(59, 130, 246, 0.4);
}
.tab-btn {
  flex: 1;
  min-width: 80px;
  background: rgba(30, 41, 59, 0.7);
  color: #cbd5e1;
  border: none;
  border-radius: 6px 6px 0 0;
  padding: 10px 8px;
  font-size: 14px;
  cursor: pointer;
  width: auto;
}
.tab-btn.active { background: #2563eb; color: white; }
.tab-content { animation: fade 0.2s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ===== TAB ADMIN ===== */
.tab-btn-admin {
  padding: 10px 16px;
  background: #334155;
  color: #fff;
  border: none;
  cursor: pointer;
  border-radius: 5px;
  margin-right: 5px;
  width: auto;
}
.tab-btn-admin.active { background: #2563eb; }
.tab-admin-content.hidden { display: none; }

/* ===== SEZIONI COLLASSABILI ===== */
details.sezione {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  margin: 8px 0;
  padding: 0 12px;
}
details.sezione > summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  color: #93c5fd;
  padding: 12px 0;
  list-style: none;
}
details.sezione > summary::before { content: "▸ "; }
details.sezione[open] > summary::before { content: "▾ "; }
details.sezione > div { padding-bottom: 12px; }

/* ===== CHECKBOX GRUPPI ===== */
.chk-group { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0; }
.chk-group label {
  display: inline-flex;
  align-items: center;
  font-weight: normal;
  margin: 0;
  color: #e2e8f0;
}
.chk-group input { width: auto; margin-right: 4px; }

/* Checkbox giorni inline */
.card > div label { display: inline; font-weight: normal; margin-top: 0; color: #e2e8f0; }
label > input.giornoChk { width: auto; margin-right: 4px; }

/* ===== SERIE / PESO / REPS ===== */
.set-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin: 3px 0;
}
.set-row input { width: 100px; }

/* ===== LISTA CLIENTI ===== */
.cliente-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  margin: 6px 0;
  background: rgba(30, 41, 59, 0.7);
  border-radius: 8px;
  border: 1px solid rgba(59, 130, 246, 0.2);
}
.cliente-info { flex: 1; min-width: 150px; }

/* ===== BADGE STATO ===== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.badge-gestione { background: #f59e0b; color: #1e293b; }
.badge-attivo { background: #16a34a; color: white; }

/* ===== LOGO ===== */
.logo { width: 140px; height: auto; margin: 10px auto; display: block; }

/* ===== GRAFICI ===== */
canvas { max-width: 100%; }

/* ===== RESPONSIVE ===== */
@media (min-width: 600px) {
  button { width: auto; }
  .card button { margin-right: 8px; }
  .tab-btn { width: auto; }
}
