*, *::before, *::after { box-sizing: border-box; }

:root {
  --sidebar-w: 240px;
  --sidebar-bg: #1e1b4b;
  --sidebar-text: #a5b4fc;
  --sidebar-active: #4f46e5;
  --sidebar-hover: rgba(255,255,255,0.06);
  --header-h: 60px;
  --primary: #4f46e5;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f8fafc;
  --border: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
  --text-muted: #64748b;
}

body {
  margin: 0;
  font-family: 'Poppins', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
}

/* ── Layout ────────────────────────────────────────────── */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo img {
  height: 32px;
  width: auto;
  display: block;
  margin-bottom: 4px;
  filter: brightness(0) invert(1);
  opacity: .9;
}

.sidebar-logo h1 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
}

.sidebar-logo span {
  font-size: 0.7rem;
  color: var(--sidebar-text);
  font-weight: 400;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.nav-section {
  padding: 12px 16px 4px;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(165,180,252,0.5);
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.nav-item-classe-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.nav-item-classe-nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item-classe-orario { font-size: .68rem; font-weight: 600; opacity: .65; }

.nav-item.active {
  background: rgba(79,70,229,0.2);
  color: #fff;
  border-left-color: var(--primary);
}

.nav-item-classe-attiva {
  background: rgba(110,231,183,0.18) !important;
  border-left-color: #6ee7b7 !important;
}

.user-info-avatar-link{text-decoration: none;}
.sidebar-footer-profile { display: flex; align-items: center; gap: 8px; }
.sidebar-footer-avatar-link { flex-shrink: 0; }
.sidebar-footer-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; display: block; }
.sidebar-footer-avatar-initials {
  background: rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; color: #fff;
}
.sidebar-footer-name-link { text-decoration: none; color: inherit; min-width: 0; }
.sidebar-footer-name { display: block; font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }

.nav-item .nav-icon { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-item .nav-icon svg { width: 16px; height: 16px; pointer-events: none; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.8rem;
  color: var(--sidebar-text);
}

.sidebar-footer strong { color: #fff; display: block; }
.sidebar-footer a { color: var(--sidebar-text); text-decoration: none; font-size: 0.75rem; }
.sidebar-footer a:hover { color: #fff; }

/* ── Main area ─────────────────────────────────────────── */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-x: hidden;
}

.admin-header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.page-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.page-subtitle {
  margin: 4px 0 0;
  font-size: .82rem;
  color: var(--muted);
}
.page-subtitle a { color: var(--primary); text-decoration: none; }
.page-subtitle a:hover { text-decoration: underline; }

.admin-content {
  padding: 28px;
  flex: 1;
}

/* ── Cards stats ───────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border-radius: 10px;
  padding: 20px;
  border: 1px solid var(--border);
}

.stat-card .stat-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.stat-card.warning {
  border-color: #fca5a5;
  background: #fef2f2;
}

.stat-card.warning .stat-value { color: #dc2626; }
.stat-card.warning .stat-label { color: #dc2626; }

/* ── Alert ─────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-warning { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.alert-success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.alert-error   { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

/* ── Table ─────────────────────────────────────────────── */
.table-container {
  background: var(--surface);
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
}


.admin-collapsible[data-key="stats"]{
  margin-bottom: 20px;
}
.admin-collapsible[data-key^="andamento-"]{
  margin-top: 20px;
}

.admin-collapsible[data-key^="dash-video"]{
  margin-top: 20px;
}

.admin-collapsible[data-key^="video-"]{
  margin-top: 20px;
}

.classe-grid-2-mt .admin-collapsible[data-key^="andamento-"]{
  margin-top: 0;
}

.admin-collapsible[data-key="andamento-7"]{
  margin-top: 0;
}

.admin-collapsible[data-key^="lezioni-"]{
  margin-top: 20px;
}

.admin-collapsible[data-key^="dash-slot-prenotazioni"]{
  margin-top: 20px;
}


#lezioni{
  margin-top: 20px;
}

.table-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.table-header h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.table-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.8rem;
  font-family: inherit;
  color: var(--text);
  background: white;
  cursor: pointer;
}

.filter-select:focus { outline: none; border-color: var(--primary);}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  padding: 10px 16px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }

.user-info { display: flex; align-items: center; gap: 10px; }
.user-info .name { font-weight: 500; }
.user-info .email { font-size: 0.78rem; color: var(--muted); }
.user-info-avatar {
  width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
  flex-shrink: 0; border: 1.5px solid var(--border);
}
.user-info-avatar-initials {
  background: linear-gradient(135deg,#6366f1,#8b5cf6);
  display: flex; align-items: center; justify-content: center;
  font-size: .68rem; font-weight: 700; color: white;
}

/* ── Badge ruolo/stato ─────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}

/* Tipo esercizio */
.badge-tipo {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-tipo-standard      { background: #eff6ff; color: #1d4ed8; }
.badge-tipo-stop_and_code { background: #fff7ed; color: #c2410c; }

.badge-studente    { background: #eff6ff; color: #1d4ed8; }
.badge-docente     { background: #eef2ff; color: #4338ca; }
.badge-tutor       { background: #f5f3ff; color: #7c3aed; }
.badge-segreteria  { background: #fdf4ff; color: #9333ea; }
.badge-admin       { background: #fef2f2; color: #dc2626; }
.badge-guest       { background: #f1f5f9; color: #64748b; }
.badge-career_coach{ background: #fff7ed; color: #c2410c; }

.badge-attivo        { background: #f0fdf4; color: #16a34a; }
.badge-in_attesa     { background: #fffbeb; color: #b45309; }
.badge-disabilitato  { background: #f1f5f9; color: #64748b; }

/* Stato classe */
.badge-bozza        { background: #fffbeb; color: #b45309; }
.badge-attiva       { background: #f0fdf4; color: #16a34a; }
.badge-archiviata   { background: #f1f5f9; color: #64748b; }

/* ── Actions ───────────────────────────────────────────── */
.actions { display: flex; align-items: center; gap: 6px; }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 7px;
  font-size: .82rem; font-weight: 500;
  font-family: inherit; cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.btn-secondary:hover { background: var(--bg); border-color: #cbd5e1; }

.btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px;
  background: var(--primary); color: #fff;
  border: 1px solid transparent; border-radius: 7px;
  font-size: .82rem; font-weight: 600;
  font-family: inherit; cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: background .12s;
}
.btn-primary:hover { background: #4338ca; }

.btn-sm {
  padding: 5px 12px;
  border: none;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn-sm-primary { background: var(--primary); color: white; }
.btn-sm-primary:hover { background: #4338ca; }
.btn-sm-ghost { background: #f1f5f9; color: var(--text); }
.btn-sm-ghost:hover { background: #e2e8f0; }
.btn-sm-danger { color: #dc2626; border-color: #fecaca; }
.btn-sm-danger:hover { background: #fef2f2; border-color: #fca5a5; color: #b91c1c; }

.badge-accesso {
  display: inline-flex;
  align-items: center;
  font-size: .72rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 10px;
  white-space: nowrap;
}
.badge-accesso-in_presenza { background: #f0fdf4; color: #16a34a; }
.badge-accesso-live        { background: #eff6ff; color: #1d4ed8; }
.badge-accesso-on_demand   { background: #f5f3ff; color: #7c3aed; }

tr.presenza-row-disabled { opacity: .55; }
tr.presenza-row-disabled td { cursor: not-allowed; }

tr.row-in-attesa td { background: #fde68a !important; }
tr.row-in-attesa:hover td { background: #fcd34d !important; }

tr.row-sospetto-nuovo td { background: #fff7ed !important; }
tr.row-sospetto-nuovo:hover td { background: #ffedd5 !important; }

/* ── Bacheca (docente/admin) ────────────────────────────── */
.msg-wrap-admin { display: flex; gap: 12px; align-items: flex-start; }
.msg-avatar-admin {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; color: white;
  flex-shrink: 0; margin-top: 2px;
}
.msg-avatar-img { object-fit: cover; }
.msg-avatar-staff    { background: linear-gradient(135deg,#f59e0b,#f97316); }
.msg-avatar-studente { background: linear-gradient(135deg,#6366f1,#8b5cf6); }
.bacheca-msg-body { font-size: .88rem; line-height: 1.6; color: var(--text); word-break: break-word; }

.mention-menu { position: fixed; z-index: 1000; background: white; border: 1.5px solid var(--border); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 240px; overflow-y: auto; }
.mention-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid #f1f5f9; transition: background .1s; }
.mention-item:last-child { border-bottom: none; }
.mention-item:hover, .mention-item.active { background: #eef2ff; }
.mention-avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg,#6366f1,#8b5cf6); display: flex; align-items: center; justify-content: center; font-size: .65rem; font-weight: 700; color: white; flex-shrink: 0; }
.mention-avatar-img { object-fit: cover; background: none; }
.mention-name { font-size: .85rem; font-weight: 600; color: var(--text); flex: 1; }
.mention-role { font-size: .72rem; color: var(--muted); }
.mention-tag { color: var(--primary); font-weight: 700; background: #eef2ff; padding: 0 4px; border-radius: 4px; }

.text-link { color: var(--primary); font-weight: 500; word-break: break-all; }
.gh-link { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; background: #0d1117; color: #e6edf3; border-radius: 8px; text-decoration: none; font-size: .82rem; border: 1px solid #30363d; margin: 3px 0; }
.gh-icon { font-weight: 700; opacity: .7; }
.gh-repo { border-color: #238636; }
.gh-gist { border-color: #1f6feb; }
.gh-pr   { border-color: #a371f7; }
.code-block { background: #1a1f2e !important; color: #abb2bf; border-radius: 8px; padding: 12px 14px; font-size: .83rem; line-height: 1.6; overflow-x: auto; margin: 6px 0; max-width: 100%; box-sizing: border-box; }
.code-block code { color: inherit; background: none; font-family: 'Fira Mono', 'Cascadia Code', Consolas, monospace; }
.inline-code { background: rgba(99,102,241,.12); color: var(--primary); padding: 1px 6px; border-radius: 4px; font-family: monospace; font-size: .88em; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; font-size: .78rem; color: var(--muted); max-width: 220px; overflow: hidden; }
.file-chip .file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.file-chip .file-size { flex-shrink: 0; }
.allegato-img { max-width: 200px; max-height: 140px; object-fit: cover; border-radius: 8px; }
.allegato-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; font-size: .78rem; color: var(--text); text-decoration: none; }
.allegato-chip:hover { background: #eef2ff; color: var(--primary); }

.nav-badge-alert {
  margin-left: auto;
  background: #dc2626;
  color: white;
  font-size: .62rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.role-form { display: flex; align-items: center; gap: 6px; }
.role-select {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.78rem;
  font-family: inherit;
  color: var(--text);
}

/* ── Search bar ────────────────────────────────────────── */
.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.search-bar input {
  flex: 1;
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.15s;
}

.search-bar input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.search-select {
  position: relative;
  margin-bottom: 10px;
}


/* ── Filter pills ───────────────────────────────────────── */
.filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: center;
}

.pill {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  border: 1.5px solid var(--border);
  color: var(--muted);
  background: white;
  transition: all 0.15s;
  white-space: nowrap;
}

.pill:hover { border-color: var(--primary); color: var(--primary); }
.pill.active { background: var(--primary); border-color: var(--primary); color: white; }
.pill svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; }

.pill-staff.active        { background: #d97706; border-color: #d97706; }
.pill-insegnanti.active   { background: #7c3aed; border-color: #7c3aed; }
.pill-studenti.active     { background: #1d4ed8; border-color: #1d4ed8; }
.pill-guest.active        { background: #64748b; border-color: #64748b; }

.sort-toggle {
  margin-left: auto;
  display: flex;
  gap: 4px;
}

.sort-btn {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  border: 1.5px solid var(--border);
  color: var(--muted);
  background: white;
}

.sort-btn.active { background: #f1f5f9; color: var(--text); border-color: #cbd5e1; }


/* Notifiche — tutti gli stili sono in /css/notifiche.css */

/* ── Accordion admin ───────────────────────────────────── */
.admin-toggle {
  cursor: pointer;
  user-select: none;
}

.admin-toggle:hover { background: #f8fafc; }

.admin-chevron {
  color: var(--muted);
  flex-shrink: 0;
  margin-left: auto;
  transition: transform 0.25s ease, color 0.15s;
}

.admin-toggle:hover .admin-chevron { color: var(--primary); }
.admin-collapsed .admin-chevron    { transform: rotate(-90deg); }

/* Contenuto collassabile — CSS Grid trick */
.admin-collapsible-body {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.25s ease;
}

.admin-collapsed .admin-collapsible-body {
  grid-template-rows: 0fr;
}

.admin-collapsible-inner {
  overflow: clip;
  min-height: 0;
}

/* ── Toast notifica ────────────────────────────────────── */
.async-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  padding: 11px 20px;
  border-radius: 9px;
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.22s, transform 0.22s;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  pointer-events: none;
}
.async-toast--show    { opacity: 1; transform: translateY(0); }
.async-toast--success { background: #1e1b4b; color: #fff; }
.async-toast--error   { background: #dc2626; color: #fff; }

/* ── Form controls (usati in tutto l'admin) ────────────── */
.form-group-admin {
  margin-bottom: 16px;
}

.form-group-admin label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-input,
.admin-select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text);
  background: white;
  box-sizing: border-box;
}

.admin-input:focus,
.admin-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

textarea.admin-input {
  resize: vertical;
}

/* ── .form-* (classe condivisa studente/admin) ─────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.form-label {
  display: block;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .875rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}
.form-textarea { resize: vertical; min-height: 80px; }

/* ── Search autocomplete ───────────────────────────────── */
.search-input:focus {
  border-color: #d1d5db !important;
  box-shadow: none !important;
  outline: none;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  z-index: 300;
  max-height: 280px;
  overflow-y: auto;
}
.search-dropdown:empty,
.search-dropdown[hidden] { display: none; }

.search-item {
  padding: 11px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.1s;
}

.search-item:last-child { border-bottom: none; }
.search-item:hover { background: #eef2ff; }

.search-item-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text);
}

.search-item-meta {
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 2px;
}

.search-no-result {
  padding: 14px 16px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

/* ── Color picker (form moduli) ────────────────────────── */
.color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: block;
  background: var(--dot-color, #ccc);
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
}

.color-radio:checked + .color-swatch {
  transform: scale(1.3);
}

/* ── Modulo row (form sequenza percorso) ───────────────── */
.modulo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.modulo-ordine {
  width: 32px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.modulo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dot-color, #ccc);
  flex-shrink: 0;
}

/* ── Riga tutoraggio nel calendario ────────────────────── */
tr.row-tutoraggio td:first-child strong { color: #7c3aed; }

/* ── Tool buttons bacheca (condivisi con student) ─────── */
.tool-btn {
  width: 40px; height: 40px; border-radius: 10px;
  border: 1.5px solid var(--border); background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-2); transition: all var(--transition);
  flex-shrink: 0; padding: 0; line-height: 1; font-size: 1.1rem;
}
/* Sovrascrive .form-group-admin label { display: block } */
label.tool-btn { display: flex; align-items: center; justify-content: center; }
.tool-btn svg { display: block; }
.tool-btn:hover            { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.tool-btn-attach:hover     { background: rgba(16,185,129,.1); color: #10b981; border-color: #10b981; }
.tool-btn-code:hover       { background: rgba(245,158,11,.1); color: #f59e0b; border-color: #f59e0b; }
.tool-btn input[type="file"] { display: none; }

/* ── Upload hint ───────────────────────────────────────── */
.mat-upload-hint {
  display: block;
  margin-top: 5px;
  font-size: .75rem;
  color: var(--muted);
}

/* ── Percorso dettaglio ────────────────────────────────── */
.percorso-dettaglio-grid {
  display: grid;
  grid-template-columns: 72% 1fr;
  gap: 20px;
  align-items: start;
}

/* ── Reazione cuore bacheca ─────────────────────────────── */
.msg-heart  { display: flex; align-items: center; margin-top: 6px; }
.heart-btn  { display: inline-flex; align-items: center; gap: 4px; background: none; border: none; cursor: pointer; color: #94a3b8; padding: 2px 4px; border-radius: 6px; transition: color .15s; }
.heart-btn:hover     { color: #ef4444; }
.heart-btn.mine      { color: #ef4444; }
.heart-cnt  { font-size: .78rem; font-weight: 600; }

/* ── Emoji picker (bacheca) ─────────────────────────────── */
.emoji-picker {
  position: fixed;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  padding: 8px;
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  z-index: 500;
  width: 184px;
}
.emoji-btn { background: none; border: none; font-size: 1.25rem; padding: 5px; border-radius: 6px; cursor: pointer; transition: background .1s; line-height: 1; }
.emoji-btn:hover { background: #f1f5f9; }
.emoji-btn.active { background: #eef2ff; box-shadow: 0 0 0 2px #6366f1; }

/* ── Chiusure scolastiche (admin) ───────────────────────── */
.chiusura-row-attiva td  { background: rgba(245,158,11,.05); }
.chiusura-badge-attiva   { background: #fef3c7; color: #92400e; font-size: .65rem; }
.chiusura-badge-futura   { background: #eff6ff; color: #1d4ed8; font-size: .65rem; }

/* ── Bacheca preview (scheda classe admin) ──────────────── */
.bacheca-preview-row    { display: flex; align-items: flex-start; gap: 10px; padding: 10px 16px; border-bottom: 1px solid #f1f5f9; }
.bacheca-preview-row:last-of-type { border-bottom: none; }
.bacheca-preview-body   { flex: 1; min-width: 0; }
.bacheca-preview-nome   { font-size: .82rem; font-weight: 600; }
.bacheca-preview-testo  { font-size: .8rem; color: var(--muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bacheca-preview-time   { font-size: .7rem; color: var(--muted); margin-top: 2px; }
.bacheca-preview-footer { padding: 8px 16px; }

/* ── Registro presenze ──────────────────────────────────── */
.pres-header { margin-bottom: 20px; }
.pres-header-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 20px; }
.pres-header-title { margin: 0; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.pres-header-sub   { margin: 4px 0 0; color: var(--muted); font-size: .82rem; }

.pres-riepilogo   { display: flex; gap: 8px; flex-wrap: wrap; }
.pres-chip        { font-size: .75rem; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.pres-chip--presente { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.pres-chip--assente  { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.pres-chip--nr       { background: #f8fafc; color: var(--muted); border: 1px solid var(--border); }

.pres-readonly-banner { margin: 12px 20px; padding: 10px 14px; background: #fffbeb; color: #b45309; border-radius: 6px; font-size: .82rem; }

.pres-table { width: 100%; border-collapse: collapse; }
.pres-th-stato { width: 200px; }
.pres-td-stato { white-space: nowrap; }
.pres-td-reg   { font-size: .8rem; }

.pres-row--presente td { background: rgba(16,185,129,.04); }
.pres-row--assente  td { background: rgba(220,38,38,.04); }
.pres-row--nr       td { background: transparent; }
.pres-row--nr:not(.pres-row--bloccato) td:first-child { border-left: 3px solid #f59e0b; }
.pres-row--bloccato { opacity: .55; }

.pres-btn-group { display: flex; gap: 6px; }
.pres-btn { padding: 5px 14px; border-radius: 6px; border: 1.5px solid var(--border); background: white; font-size: .8rem; font-weight: 600; cursor: pointer; transition: all .12s; }
.pres-btn--presente       { color: #16a34a; border-color: #bbf7d0; }
.pres-btn--presente.active{ background: #16a34a; color: white; border-color: #16a34a; }
.pres-btn--assente        { color: #dc2626; border-color: #fecaca; }
.pres-btn--assente        { color: #969696; border-color: #dddddd; }
.pres-btn--assente.active { background: #dc2626; color: white; border-color: #dc2626; }

.pres-stato-ro { font-size: .82rem; font-weight: 600; }
.pres-stato-ro--presente { color: #16a34a; }
.pres-stato-ro--assente  { color: #dc2626; }
.pres-stato-ro--nr       { color: var(--muted); }

.pres-reg-nome  { font-size: .82rem; font-weight: 600; }
.pres-reg-ruolo { font-size: .68rem; color: var(--muted); }
.pres-fonte-badge { font-size: .72rem; }
.pres-nr-label  { color: var(--muted); font-size: .8rem; }
.pres-od-note   { font-size: .66rem; color: var(--muted); margin-top: 2px; }

.pres-footer    { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.pres-bulk      { display: flex; gap: 8px; margin-right: auto; }
.pres-submit    { padding: 8px 24px; }
.pres-locked    { color: var(--muted); font-size: .85rem; }

/* ── Icona modulo (helper globale) ─────────────────────── */
.modulo-icon-img  { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; flex-shrink: 0; display: inline-block; vertical-align: middle; }
.modulo-icon-dot  { width: var(--dot-size, 10px); height: var(--dot-size, 10px); border-radius: 50%; background: var(--dot-bg, #e2e8f0); flex-shrink: 0; display: inline-block; vertical-align: middle; }

/* ── Dettaglio classe ──────────────────────────────────── */
.det-esercizio-grid  { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; align-items: start; }
.det-prov-row        { display: flex; gap: 8px; }
.det-badge-ritirato  { background: #fef9c3; color: #854d0e; font-size: .7rem; }
.det-label-opt       { font-weight: 400; }
.link-nessuno-label  { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); margin-top: 6px; cursor: pointer; font-weight: 400; text-transform: none; letter-spacing: 0; }
.det-link-small      { color: var(--primary); font-weight: 500; text-decoration: none; }
.det-link-small:hover{ text-decoration: underline; }
.det-td-autore       { color: var(--muted); font-size: .82rem; }
.det-td-data         { color: var(--muted); font-size: .8rem; }
.det-btn-elimina-mat { background: #fef2f2; color: #dc2626; }
.det-andamento-sub   { font-size: .72rem; color: var(--muted); }
.det-copia-select    { width: 100%; margin-bottom: 12px; }
.det-copia-empty     { color: var(--muted); text-align: center; padding: 20px; }
.classe-header-box  { padding: 20px; margin-bottom: 20px; }
.classe-header-main { display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.classe-header-left { display: flex; align-items: start; gap: 12px; }
.classe-header-nome { margin: 0; font-size: 1.1rem; }
.classe-header-meta { margin: 4px 0 0; color: var(--muted); font-size: .82rem; }
.classe-token-code  { background: #f1f5f9; padding: 1px 6px; border-radius: 4px; }
.classe-guest-pill  { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-size: .72rem; font-weight: 700; padding: 2px 10px; border-radius: 10px; background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.classe-header-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.classe-stato-badge { font-size: .78rem; padding: 4px 12px; }
.btn-pubblica  { background: #16a34a; color: white; padding: 6px 14px; }
.btn-muted     { color: var(--muted); }
.btn-danger {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px;
  background: #fef2f2; color: #dc2626;
  border: 1px solid #fecaca; border-radius: 7px;
  font-size: .82rem; font-weight: 600;
  font-family: inherit; cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.btn-danger:hover { background: #fee2e2; border-color: #dc2626; }
.btn-danger-fill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 20px; background: #dc2626; color: #fff;
  border: none; border-radius: 8px; font-size: .875rem; font-weight: 600;
  font-family: inherit; cursor: pointer; text-decoration: none;
  transition: background .15s; white-space: nowrap;
}
.btn-danger-fill:hover { background: #b91c1c; }

/* Griglie layout sezioni */
.classe-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.classe-grid-2-mt { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; margin-top: 20px; }

/* Form panel (genera, aggiungi, materiali, esercizi) */
.panel-form { padding: 20px; border-bottom: 1px solid var(--border); background: #f8fafc; }
.panel-form h3 { margin: 0 0 16px; font-size: .9rem; }
.panel-form-grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.panel-form-grid-2    { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.panel-form-actions   { display: flex; gap: 8px; margin-top: 4px; }
.panel-form-row       { display: flex; gap: 8px; align-items: center; }
.admin-input-readonly { background: #f8fafc; color: var(--text); cursor: default; }
.span-full { grid-column: 1 / -1; }
#genera-quiz-corso{margin-bottom: 20px;}


/* Giorni settimana checkbox */
.giorni-wrap  { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.giorno-label { display: flex; align-items: center; gap: 4px; font-size: .85rem; font-weight: 500; cursor: pointer; }

/* Table cells */
.td-nowrap    { white-space: nowrap; }
.td-sm        { font-size: .82rem; }
.td-note      { font-size: .78rem; color: var(--muted); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-link      { font-size: .78rem; color: var(--primary); }
.td-muted-sm  { color: var(--muted); font-size: .78rem; }
.td-empty     { text-align: center; color: var(--muted); padding: 20px; font-size: .85rem; }
.empty-icon   { font-size: 2rem; }
.row-tutoraggio { background: rgba(124,58,237,.03); }

/* Studenti: pillole percorso/modulo singolo */
.pill-percorso { display: inline-block; margin-top: 3px; font-size: .7rem; padding: 2px 8px; border-radius: 10px; background: #ede9fe; color: #7c3aed; font-weight: 500; }
.pill-modulo   { display: inline-block; margin-top: 3px; font-size: .7rem; padding: 2px 8px; border-radius: 10px; background: #f1f5f9; color: #64748b; }
.matricola-code { font-size: .7rem; background: #f1f5f9; padding: 1px 6px; border-radius: 4px; margin-left: 6px; color: var(--muted); }

/* Alert warning eliminazione */
.alert-elimina-box  { border-width: 2px; padding: 18px 20px; }
.alert-elimina-title { font-size: 1.05rem; font-weight: 800; margin-bottom: 8px; }
.alert-elimina-text { margin: 0 0 14px; }
.alert-elimina-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Paginazione utenti ────────────────────────────────── */
/* ── Header iscrivi-classe / iscrivi-percorso ──────────── */
.iscrivi-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.iscrivi-avatar {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
}
.iscrivi-avatar-img  { object-fit: cover; border: 1.5px solid var(--border); }
.iscrivi-avatar-initials {
  background: linear-gradient(135deg,#6366f1,#8b5cf6);
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem; font-weight: 700; color: white;
}
.iscrivi-info  { flex: 1; min-width: 0; }
.iscrivi-nome  { margin: 0; font-size: 1.05rem; font-weight: 600; }
.iscrivi-meta  { margin: 2px 0 0; color: var(--muted); font-size: .8rem; }
.iscrivi-back  { margin-left: auto; }

.percorso-meta-row {
  display: block;
  margin-top: 3px;
  font-size: .75rem;
  color: var(--muted);
}
.percorso-meta-row span::after { content: ' · '; }
.percorso-meta-row span:last-of-type::after { content: ''; }
.percorso-token {
  font-size: .7rem;
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--muted);
  font-family: monospace;
}
.percorso-desc { color: var(--muted); font-size: .82rem; }

.utenti-caption {
  caption-side: top;
  text-align: left;
  padding: 10px 20px 8px;
  font-size: .78rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.utenti-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 10px;
}
.utenti-count { font-size: .78rem; color: var(--muted); }
.paginazione { display: flex; align-items: center; gap: 4px; }
.pag-btn {
  padding: 5px 10px; border-radius: 6px;
  font-size: .78rem; font-weight: 600;
  color: var(--text); text-decoration: none;
  border: 1px solid var(--border);
  background: white;
  transition: background .1s;
}
.pag-btn:hover { background: var(--bg); }
.pag-btn-active { background: var(--primary) !important; color: white !important; border-color: var(--primary); }
.pag-ellipsis { font-size: .78rem; color: var(--muted); padding: 0 4px; }

.anno-filter-form { display: inline-flex; align-items: center; }
.anno-select { height: 30px; font-size: .78rem; padding: 0 8px; cursor: pointer; }

/* ── Pagina modifica utente ─────────────────────────────── */
.modifica-layout     { max-width: 680px; }
.modifica-form-body  { padding: 20px 24px 28px; }
.modifica-grid-2     { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modifica-grid-3     { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.modifica-actions    { display: flex; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.modifica-submit     { padding: 8px 22px; font-size: .875rem; }
.modifica-rimuovi-avatar { display: flex; align-items: center; gap: 5px; font-size: .75rem; margin: -8px 0 20px; cursor: pointer; color: var(--muted); }

.modifica-section-title {
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--primary); margin: 28px 0 14px;
  padding-top: 20px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.modifica-section-hint { font-size: .7rem; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); }
.modifica-section-sub  { font-size: .72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 18px 0 10px; }

.modifica-check-group  { justify-content: flex-end; }
.modifica-checkbox     { display: flex; align-items: center; gap: 6px; font-size: .85rem; cursor: pointer; margin-top: 8px; }
.modifica-checkbox input { accent-color: var(--primary); width: 14px; height: 14px; }

.admin-input-upper { text-transform: uppercase; }
.modifica-input-matricola { background: #fef9c3; border-color: #fde68a; font-weight: 600; letter-spacing: .05em; }
.modifica-prov-nazione    { display: flex; gap: 6px; }
.modifica-input-prov      { width: 60px; }
.modifica-input-matricola:focus { border-color: #f59e0b; }
.modifica-readonly-date { color: var(--muted); font-size: .82rem; cursor: default; }
.input-hint  { color: var(--muted); font-size: .75rem; margin-top: 3px; display: block; }
.req         { color: #dc2626; }
.label-opt   { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); }

/* ── Wizard sposta coorte ───────────────────────────────── */
.sposta-layout { max-width: 760px; }

.sposta-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.sposta-header-info { display: flex; align-items: flex-start; gap: 14px; flex: 1; }
.sposta-titolo { margin: 0 0 4px; font-size: 1.1rem; }
.sposta-sub    { margin: 0; font-size: .82rem; color: var(--muted); line-height: 1.5; max-width: 500px; }
.sposta-percorso-badge { background: #ede9fe; color: #7c3aed; padding: 6px 14px; border-radius: 20px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.sposta-percorso-select { display: flex; align-items: center; gap: 8px; }

.sposta-moduli { display: flex; flex-direction: column; gap: 12px; margin-bottom: 28px; }

.sposta-modulo {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: white;
  overflow: hidden;
}
.sposta-modulo--completato { opacity: .65; }
.sposta-modulo--da_spostare { border-left: 3px solid #6366f1; }
.sposta-modulo--non_iscritto { border-left: 3px solid #e2e8f0; border-style: dashed; }
.sposta-modulo--ritirato { border-left: 3px solid #f59e0b; }

.sposta-modulo-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}
.sposta-modulo-num  { font-size: .75rem; font-weight: 700; color: var(--muted); min-width: 18px; }
.sposta-modulo-nome { font-weight: 600; font-size: .9rem; flex: 1; }
.sposta-modulo-stato { margin-left: auto; }

.sposta-completato-info { padding: 10px 16px; font-size: .82rem; color: var(--muted); }

.sposta-azioni      { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.sposta-classe-attuale { font-size: .82rem; background: #f1f5f9; padding: 8px 12px; border-radius: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.sposta-radio-group { display: flex; flex-direction: column; gap: 6px; }
.sposta-radio       { display: flex; align-items: center; gap: 8px; font-size: .85rem; cursor: pointer; padding: 4px 0; }
.sposta-radio input { accent-color: var(--primary); width: 15px; height: 15px; cursor: pointer; flex-shrink: 0; }
.sposta-radio--sposta span { color: var(--primary); font-weight: 500; }
.sposta-radio--salta  span { color: var(--muted); }

.sposta-select-nuova { margin-left: 23px; margin-top: 2px; }
.sposta-select-nuova .admin-select { width: 100%; max-width: 460px; }
.sposta-no-classi { font-size: .78rem; color: #f97316; margin: 4px 0 0; }

.sposta-label    { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.sposta-label-sm { font-size: .72rem; color: var(--muted); }

.sposta-form-actions { display: flex; gap: 12px; align-items: center; padding: 20px 0; border-top: 1px solid var(--border); }

/* ── Programma di oggi (dashboard) ─────────────────────── */
.oggi-box { margin-bottom: 20px; border-left: 3px solid var(--primary); }

.oggi-box > .table-header{background-color: #e3eaff;}

.oggi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 16px 20px 20px;
}

.oggi-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  background: white;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.oggi-card--in-corso { border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99,102,241,.12); }
.oggi-card--passata  { opacity: .6; }

.oggi-card-header  { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.oggi-card-corso   { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .88rem; }
.oggi-corso-link   { text-decoration: none; color: var(--text); }
.oggi-corso-link:hover { color: var(--primary); }
.oggi-card-badges  { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.oggi-badge-live   { background: #fef2f2; color: #dc2626; font-size: .65rem; animation: pulse-live 1.5s infinite; }
@keyframes pulse-live { 0%,100%{opacity:1} 50%{opacity:.5} }

.oggi-orario  { display: flex; align-items: baseline; gap: 6px; }
.oggi-ora     { font-size: 1.15rem; font-weight: 800; color: var(--primary); }
.oggi-durata  { font-size: .72rem; color: var(--muted); }

.oggi-docente         { background: #f8fafc; border-radius: 8px; padding: 10px 12px; }
.oggi-docente-nome    { font-weight: 600; font-size: .85rem; display: block; }
.oggi-docente-ruolo   { font-size: .65rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.oggi-docente-contatti{ margin-top: 6px; display: flex; flex-direction: column; gap: 3px; }
.oggi-contatto  { font-size: .78rem; text-decoration: none; color: var(--text); }
.oggi-tel       { color: #16a34a; font-weight: 600; }
.oggi-mail      { color: var(--primary); }
.oggi-notel     { color: var(--muted); font-style: italic; }

.oggi-info-row  { display: flex; gap: 6px; flex-wrap: wrap; }
.oggi-chip      { font-size: .72rem; background: #f1f5f9; padding: 3px 8px; border-radius: 20px; color: var(--text); }
.oggi-chip--link{ background: #eff6ff; color: #1d4ed8; text-decoration: none; }
.oggi-chip--link:hover { background: #dbeafe; }

.oggi-note    { font-size: .78rem; color: var(--muted); background: #fffbeb; padding: 6px 10px; border-radius: 6px; border-left: 2px solid #fcd34d; }
.oggi-actions { display: flex; gap: 6px; margin-top: auto; padding-top: 4px; border-top: 1px solid #f1f5f9; }

/* ── Dashboard admin ───────────────────────────────────── */
.dash-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; align-items: start; }
.dash-corso-link { text-decoration: none; color: inherit; }
.dash-corso-link:hover .name { color: var(--primary); }
.dash-sub { font-size: .75rem; color: var(--muted); }

.dash-stats-box   { margin-bottom: 20px; }
.dash-stats-grid  { padding: 16px 20px 20px; }

.dash-calendario-box{ margin-bottom: 20px; border-left: 3px solid #6366f1; }
.dash-registri-box  { margin-top: 20px; border-left: 3px solid #f59e0b; }
.dash-esercizi-box  { margin-top: 20px; border-left: 3px solid #8b5cf6; }
.dash-materiali-box { margin-top: 20px; border-left: 3px solid #06b6d4; }
.dash-sicurezza-box { margin-top: 20px; border-left: 3px solid #ef4444; }

.dash-calendario-box[data-key="dash-calendario"]{
  margin-top:20px
}

.dash-tutto-ok  { padding: 14px 20px; font-size: .85rem; color: #16a34a; }

.badge-xs        { font-size: .6rem; }
.badge-azienda   { background: #ede9fe; color: #6d28d9; }
.badge-elearning { background: #ecfdf5; color: #065f46; }
.badge-ondemand  { background: #eff6ff; color: #1d4ed8; }
.badge-count-viola { background: #ede9fe; color: #7c3aed; font-size: .72rem; }

.badge-success        { background: #dcfce7; color: #166534; }
.badge-warning        { background: #fef9c3; color: #854d0e; }
.badge-info           { background: #eff6ff; color: #1d4ed8; }
.lz-video-archiviata  { background: #f1f5f9; color: #64748b; }
.lz-video-summary     { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.alert-link     { margin-left: 8px; color: inherit; font-weight: 600; text-decoration: none; }
.alert-link:hover { text-decoration: underline; }

.td-mono        { font-family: monospace; font-size: .78rem; }
.td-danger      { font-size: .78rem; color: #dc2626; }

/* ── Statistiche scuola ────────────────────────────────── */
.stat-riepilogo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.stat-riepilogo-card {
  background: white; border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px; text-align: center;
}
.stat-riepilogo-card--warn  { border-color: #fde68a; background: #fffbeb; }
.stat-riepilogo-card--alert { border-color: #fca5a5; background: #fef2f2; }
.stat-riepilogo-value { font-size: 1.6rem; font-weight: 800; color: var(--text); line-height: 1; }
.stat-riepilogo-label { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-top: 5px; }
.stat-riepilogo-card--warn  .stat-riepilogo-value { color: #b45309; }
.stat-riepilogo-card--alert .stat-riepilogo-value { color: #dc2626; }

.stat-filtro-bar  { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.stat-filtro-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stat-filtro-label{ font-size: .78rem; font-weight: 600; color: var(--muted); }
.stat-filtro-select{ min-width: 220px; }

.stat-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-kpi-grid--wide { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.stat-kpi-card {
  background: white; border: 1px solid var(--border);
  border-radius: 12px; padding: 18px 20px;
}
.stat-kpi-card--alert { border-color: #fca5a5; background: #fef2f2; }
.stat-kpi-value { font-size: 2rem; font-weight: 800; line-height: 1; color: var(--text); }
.stat-kpi-value--muted { color: var(--muted); }
.stat-kpi-den   { font-size: 1.1rem; font-weight: 500; color: var(--muted); }
.stat-kpi-label { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-top: 6px; }
.stat-kpi-sub   { font-size: .68rem; color: var(--muted); margin-top: 2px; }
.stat-kpi-sub--warn { color: #b45309; font-weight: 600; }

.stat-rank { font-size: .88rem; font-weight: 700; color: var(--muted); width: 36px; }

.stat-tab-group { display: flex; gap: 4px; }
.stat-tab {
  padding: 4px 12px; border-radius: 20px; border: 1px solid var(--border);
  background: white; font-size: .75rem; font-weight: 500; cursor: pointer;
  color: var(--muted); transition: background .12s, color .12s;
}
.stat-tab:hover { background: #f1f5f9; color: var(--text); }
.stat-tab.active { background: var(--primary); color: white; border-color: var(--primary); }

.kpi-indigo { color: #6366f1; }
.kpi-orange { color: #f97316; }
.kpi-green  { color: #10b981; }
.kpi-purple { color: #8b5cf6; }
.kpi-teal   { color: #0891b2; }
.kpi-slate  { color: #64748b; }
.kpi-muted  { color: #94a3b8; }

.stat-rischio-box { margin-bottom: 20px; border-left: 3px solid #ef4444; }
.stat-motivo-badge { font-size: .65rem; margin-right: 4px; }
.stat-streak { color: #f59e0b; font-weight: 700; }

/* ── Pagina conferma eliminazione ──────────────────────── */
.elimina-card { max-width: 580px; overflow: hidden; background: white; border-radius: 10px; border: 1px solid var(--border); }

.elimina-banner {
  background: #fef2f2; border-bottom: 2px solid #fecaca;
  padding: 20px 24px; display: flex; align-items: flex-start; gap: 14px;
}
.elimina-banner-icon { font-size: 2rem; flex-shrink: 0; }
.elimina-banner-title { font-size: 1rem; font-weight: 800; color: #dc2626; margin-bottom: 4px; }
.elimina-banner-text { margin: 0; font-size: .875rem; color: #991b1b; line-height: 1.5; }

.elimina-body { padding: 24px; }

.elimina-classe-info {
  background: #f8fafc; border-radius: 10px; border: 1px solid var(--border);
  padding: 14px 18px; margin-bottom: 24px; display: flex; align-items: center; gap: 12px;
}
.elimina-classe-nome { font-weight: 700; font-size: .95rem; }
.elimina-classe-meta { font-size: .78rem; color: var(--muted); margin-top: 2px; }

.elimina-blocco {
  background: #fef3c7; border: 1.5px solid #fde68a; border-radius: 10px;
  padding: 18px; margin-bottom: 20px;
}
.elimina-blocco-title { font-weight: 700; color: #92400e; margin-bottom: 10px; }
.elimina-blocco-text  { margin: 0 0 10px; font-size: .875rem; color: #78350f; line-height: 1.5; }

.elimina-lista { margin: 0; padding-left: 20px; font-size: .875rem; color: #78350f; line-height: 1.8; }

.elimina-ok-text { font-size: .88rem; color: var(--muted); margin-bottom: 20px; }

.elimina-actions { display: flex; justify-content: flex-end; gap: 10px; }

.btn-sm-danger-fill { background: #dc2626; color: white; padding: 8px 20px; font-size: .875rem; font-weight: 700; border: none; border-radius: 6px; cursor: pointer; }
.btn-sm-danger-fill:hover { background: #b91c1c; }

/* ── Modale generica ───────────────────────────────────── */
.modale-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
}
.modale-overlay[hidden] { display: none; }
.modale-card {
  background: white; border-radius: 14px; width: 100%; max-width: 580px;
  max-height: 85vh; overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.modale-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px 16px; border-bottom: 1px solid var(--border);
}
.modale-header h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.modale-close { background: none; border: none; font-size: 1.1rem; cursor: pointer; color: var(--muted); }
.modale-close:hover { color: var(--text); }
.modale-label { display: block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 6px; }
#copia-step1, #copia-step2 { padding: 20px 22px; }
.modale-step2-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.modale-step2-header span { font-size: .82rem; font-weight: 600; color: var(--text-2, var(--muted)); }
.modale-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); gap: 10px; }
.modale-risultato { margin: 16px 22px 22px; padding: 12px 16px; border-radius: 8px; font-size: .88rem; font-weight: 600; }
.modale-risultato-ok  { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.modale-risultato-err { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

/* Lista studenti nella modale copia */
.copia-studenti-list { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.copia-studente-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  border: 1.5px solid var(--border);
  transition: background .12s;
}
.copia-studente-row:hover { background: #f8fafc; }
.copia-studente-row input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); flex-shrink: 0; }
.copia-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.copia-avatar-initials {
  background: linear-gradient(135deg,#6366f1,#8b5cf6);
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem; font-weight: 700; color: white;
}
.copia-info { flex: 1; min-width: 0; }
.copia-nome  { font-size: .85rem; font-weight: 600; }
.copia-email { font-size: .72rem; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-top: 1px; }

/* ── Profilo studente ──────────────────────────────────── */
.profilo-header {
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

.profilo-avatar {
  width: 128px; height: 128px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.6rem; font-weight: 800; color: white;
  flex-shrink: 0;
}
.profilo-avatar-img { object-fit: cover; border: 3px solid var(--surface); box-shadow: 0 2px 10px rgba(0,0,0,.1); }

.profilo-info { flex: 1; min-width: 0; }

.profilo-nome { margin: 0 0 6px; font-size: 1.2rem; font-weight: 800; }

.profilo-meta {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  font-size: .82rem; color: var(--muted); margin-bottom: 4px;
}

.profilo-matricola {
  background: #f1f5f9; padding: 2px 8px; border-radius: 6px;
  font-size: .75rem; color: var(--muted);
}

.profilo-linkedin { font-size: .78rem; color: var(--primary); }

.profilo-contacts { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 4px; }
.profilo-contact-text { font-size: .78rem; color: var(--muted); }

.profilo-actions         { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; min-width: 180px; }
.profilo-action-group    { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.profilo-action-label    { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }

/* Collassabile azioni pericolose */
.profilo-danger-details{position: relative;}
.profilo-danger-details summary { list-style: none; cursor: pointer; }
.profilo-danger-details summary::-webkit-details-marker { display: none; }
.profilo-danger-summary  { user-select: none; }
.profilo-danger-panel    {
  margin-top: 6px;
  background: var(--bg-hover); border: 1px solid var(--border); border-radius: 5px;
  padding: 2px; display: flex; flex-direction: column; gap: 4px;
  position: absolute;
  top:-6px;
  left: 105%;
  z-index: 10;
  width: 135px;
}
.profilo-danger-panel .btn-sm { justify-content: flex-start; }

/* Ruolo inline nella sezione info */
.profilo-ruolo-inline {
  display: flex; align-items: center; gap: 6px; margin-top: 10px; flex-wrap: wrap;
}
.profilo-ruolo-inline .profilo-action-label { font-size: .72rem; }

/* Pagamento per classe nella tabella classi */
.profilo-td-pagamento { white-space: nowrap; }
.profilo-pagamento-form { display: flex; flex-direction: column; gap: 4px; }
.profilo-pagamento-select {
  font-size: .78rem; padding: 3px 6px; border: 1px solid var(--border);
  border-radius: 5px; background: var(--bg-card); color: var(--text);
  font-family: inherit; cursor: pointer; max-width: 160px;
}
.profilo-pagamento-note {
  font-size: .78rem; padding: 3px 7px; border: 1px solid var(--border);
  border-radius: 5px; background: var(--bg-card); color: var(--text);
  font-family: inherit; max-width: 160px;
}
.profilo-pagamento-note--hidden { display: none; }
.profilo-pagamento-save {
  align-self: flex-start; padding: 2px 8px; font-size: .72rem; font-weight: 700;
  background: var(--primary); color: #fff; border: none; border-radius: 4px;
  cursor: pointer; font-family: inherit; transition: background .12s;
}
.profilo-pagamento-save:hover { background: #4338ca; }

.profilo-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-top: 20px;
}

.profilo-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow);
}

.profilo-stat-value { font-size: 1.8rem; font-weight: 800; line-height: 1; }
.profilo-stat-total { font-size: .9rem; font-weight: 500; color: var(--muted); }

.profilo-pct-pill {
  display: inline-block; padding: 1px 7px;
  border-radius: 8px; font-size: .72rem; font-weight: 700;
}
.profilo-pct-pill.ok      { background: #f0fdf4; color: #16a34a; }
.profilo-pct-pill.warn    { background: #fffbeb; color: #b45309; }
.profilo-pct-pill.danger  { background: #fef2f2; color: #dc2626; }
.profilo-pct-pill.neutral { background: #f5f3ff; color: #7c3aed; }

.andamento-stat { display: flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 500; }

/* Tabella lezioni full-width */
.lezioni-table .td-center { text-align: center; }
.lezione-docente { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lezione-link-icon { font-size: .9rem; font-weight: 700; color: var(--primary); text-decoration: none; }
.lezione-link-icon:hover { opacity: .75; }
.lezione-note-icon { cursor: default; font-size: .9rem; }
.lezione-presenze-link { color: var(--text-2,var(--muted)); font-weight: 600; text-decoration: none; font-size: .82rem; }
.lezione-presenze-link:hover { color: var(--primary); }
.row-at-risk td { background: rgba(239,68,68,.04) !important; }
.row-at-risk:hover td { background: rgba(239,68,68,.08) !important; }
.user-info-link { text-decoration: none; color: inherit; }
.user-info-link:hover .name { color: var(--primary); }
.user-info-avatar-link { flex-shrink: 0; }
.user-info-avatar-link:hover .user-info-avatar,
.user-info-avatar-link:hover .user-info-avatar-initials { opacity: .8; box-shadow: 0 0 0 2px var(--primary); }
.profilo-stat-label { font-size: .72rem; font-weight: 700; color: var(--muted); margin: 6px 0 2px; text-transform: uppercase; letter-spacing: .04em; }
.profilo-stat-sub   { font-size: .68rem; color: var(--text-3); }

.profilo-mini-bar-wrap { height: 5px; background: #f1f5f9; border-radius: 99px; overflow: hidden; width: 60px; display: inline-block; vertical-align: middle; margin-right: 4px; }
.profilo-mini-bar      { height: 100%; border-radius: 99px; transition: width .4s; width: var(--bar-width, 0%); }
.profilo-mini-bar--ok     { background: #10b981; }
.profilo-mini-bar--warn   { background: #f59e0b; }
.profilo-mini-bar--danger { background: #ef4444; }

.profilo-classe-cell  { display: flex; align-items: center; gap: 7px; }
.profilo-classe-link  { font-weight: 500; font-size: .85rem; text-decoration: none; color: var(--text); }
.profilo-classe-link:hover { color: var(--primary); }
.profilo-riga-ritirata td { opacity: .6; }
.profilo-badge-ritirato { background: #fef9c3; color: #854d0e; font-size: .62rem; margin-left: 4px; }
.profilo-btn-ritira        { color: #b45309; border-color: #fde68a; background: #fffbeb; }
.profilo-btn-ritira:hover  { background: #fef3c7; }
.profilo-btn-riattiva      { color: #16a34a; border-color: #bbf7d0; background: #f0fdf4; }
.profilo-btn-riattiva:hover{ background: #dcfce7; }
.profilo-btn-disattiva     { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.profilo-btn-riattiva-dis  { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
.badge-ritirato { background: #fef9c3; color: #854d0e; border: 1px solid #fde68a; }
.profilo-btn-reiscrivi { font-size: .72rem; padding: 2px 10px; color: #4f46e5; border-color: #c7d2fe; background: #eef2ff; }
.profilo-btn-reiscrivi:hover { background: #e0e7ff; }

.profilo-badge-grid {
  display: flex; flex-wrap: wrap; gap: 12px;
  padding: 16px 18px;
}

.profilo-badge-item { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; width: 56px; }
.profilo-badge-circle { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; background: var(--badge-bg, #6366f1); }
.profilo-badge-label { font-size: .62rem; font-weight: 600; color: var(--muted); line-height: 1.2; }

/* ── Docente dashboard ─────────────────────────────────── */
.doc-oggi-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.doc-oggi-lezione   { border-color: #6366f1; background: linear-gradient(135deg,rgba(99,102,241,.04),rgba(139,92,246,.04)); }
.doc-oggi-tutoraggio{ border-color: #7c3aed; background: linear-gradient(135deg,rgba(124,58,237,.04),rgba(167,139,250,.04)); }

.doc-oggi-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
.doc-oggi-ora    { font-size:.8rem; font-weight:700; color:var(--muted); }
.doc-oggi-classe { font-size:.98rem; font-weight:700; color:var(--text); margin-bottom:4px; }
.doc-oggi-sub    { font-size:.78rem; color:var(--muted); margin-bottom:12px; }
.doc-oggi-actions{ display:flex; gap:8px; flex-wrap:wrap; }

.doc-classe-card {
  display:block; padding:14px; background:var(--surface);
  border:1px solid var(--border); border-radius:10px;
  text-decoration:none; color:var(--text);
  transition:box-shadow var(--transition), border-color var(--transition);
  box-shadow: var(--shadow);
}
.doc-classe-card:hover { box-shadow:var(--shadow-md); border-color:var(--primary); }
.doc-classe-attiva    { border-color: rgba(99,102,241,.3); }

.row-oggi td { background: rgba(99,102,241,.04); }
.badge-oggi  { font-size:.62rem; font-weight:800; background:#6366f1; color:white; padding:1px 7px; border-radius:8px; letter-spacing:.04em; }

/* ── Badge "da correggere" ─────────────────────────────── */
.badge-da-correggere {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: .7rem;
  font-weight: 700;
  background: rgba(245,158,11,.15);
  color: #b45309;
  border: 1px solid rgba(245,158,11,.3);
  margin-left: 6px;
  animation: pulse-amber 2s infinite;
}

@keyframes pulse-amber {
  0%, 100% { opacity: 1; }
  50%       { opacity: .6; }
}

.btn-sm-warning {
  background: rgba(245,158,11,.12);
  color: #b45309;
  border: 1.5px solid rgba(245,158,11,.4);
  font-weight: 600;
}

.btn-sm-warning:hover {
  background: #f59e0b;
  color: white;
  border-color: #f59e0b;
}

/* ── Download link materiali ───────────────────────────── */
.mat-download-link {
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
}

.mat-download-link:hover { text-decoration: underline; }

/* ── Empty state ───────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}

.empty-state p { margin: 8px 0 0; font-size: 0.85rem; }

/* ── Shared form-container variants ───────────────────────── */
.form-container-sm   { max-width: 480px; padding: 28px; }
.form-container-md   { max-width: 600px; padding: 28px; }
.form-container-lg   { max-width: 640px; padding: 28px; }
.form-container-xl   { max-width: 680px; padding: 28px; }
.form-container-pad  { padding: 20px; margin-bottom: 20px; }

/* ── Shared heading inside form containers ─────────────────── */
.form-heading        { margin: 0 0 24px; font-size: 1rem; }
.form-heading-tight  { margin: 0 0 6px; font-size: 1rem; }
.form-heading-sub    { margin: 0 0 24px; color: var(--muted); font-size: .82rem; }

/* ── Required/optional label decorators ───────────────────── */
.label-required  { color: #dc2626; }
.label-small     { font-weight: 400; text-transform: none; letter-spacing: 0; }
.label-small-opt { font-weight: 400; }

/* ── Shared form action row ────────────────────────────────── */
.form-actions         { display: flex; gap: 10px; margin-top: 20px; }
.form-actions-mt24    { display: flex; gap: 10px; margin-top: 24px; }
.form-actions-center  { display: flex; gap: 10px; margin-top: 20px; align-items: center; flex-wrap: wrap; }
.form-btn-main        { padding: 8px 20px; font-size: .875rem; }
.form-btn-main-sm     { padding: 8px 20px; font-size: 0.875rem; }
.form-actions-right   { margin-left: auto; }

/* ── Shared layout grids used inside forms ─────────────────── */
.grid-2col     { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3col     { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── Shared flex helpers ───────────────────────────────────── */
.flex-center         { display: flex; align-items: center; }
.flex-center-gap8    { display: flex; align-items: center; gap: 8px; }
.flex-center-gap10   { display: flex; align-items: center; gap: 10px; }
.flex-center-gap12   { display: flex; align-items: center; gap: 12px; }
.flex-center-gap14   { display: flex; align-items: center; gap: 14px; }
.flex-center-gap16   { display: flex; align-items: center; gap: 16px; }
.flex-between        { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.flex-between-start  { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.flex-gap8           { display: flex; gap: 8px; }
.flex-gap8-wrap      { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.flex-gap8-center    { display: flex; gap: 8px; align-items: center; }
.flex-gap10          { display: flex; gap: 10px; }
.flex-gap10-center   { display: flex; gap: 10px; align-items: center; }
.flex-1              { flex: 1; }
.flex-shrink0        { flex-shrink: 0; }

/* ── classi/form.ejs ───────────────────────────────────────── */
.classi-form-modulo-info {
  background: #f8fafc;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: .875rem;
  border: 1px solid var(--border);
}
.classi-form-modulo-label {
  color: var(--muted);
  font-size: .72rem;
  display: block;
  margin-bottom: 2px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.classi-form-modulo-note {
  color: var(--muted);
  display: block;
  margin-top: 2px;
}
.classi-checks-group { display: flex; flex-direction: column; gap: .45rem; padding-top: 2px; }
.classi-cb-indent { margin-left: 1.5rem; }
.classi-banner-section { margin-top: 24px; background: #f0f4ff; border: 1px solid #d1dbfe; border-radius: 8px; padding: 1rem 1.1rem; }
.classi-form-checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.classi-form-checkbox {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}
.classi-form-checkbox-label {
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  display: flex; flex-direction: column; gap: 2px;
}
.classi-form-hint {
  font-size: .75rem; font-weight: 400; color: var(--text-muted);
}
.tipo-corso-radio-group {
  display: flex;
  gap: 12px;
}
.tipo-corso-radio-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  flex: 1;
  transition: border-color .15s, background .15s;
}
.tipo-corso-radio-label:has(input:checked) {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 6%, transparent);
}
.tipo-corso-radio-label input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--primary);
  flex-shrink: 0;
}
.tipo-corso-radio-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: .875rem;
}
.tipo-corso-radio-text strong {
  font-weight: 600;
  color: var(--text);
}
.classi-form-nota-div {
  font-size: .75rem;
  color: var(--muted);
  margin-top: 1px;
}

/* ── classi/index.ejs ──────────────────────────────────────── */
.classi-index-filter-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.classi-index-pill   { padding: 4px 12px; font-size: .75rem; }
.classi-index-new-btn{ margin-left: 8px; }
.classi-index-td-modulo   { color: var(--muted); font-size: .82rem; }
.classi-index-td-date     { font-size: .8rem; color: var(--muted); }
.classi-index-td-orario   { white-space: nowrap; font-size: .82rem; }
.classi-index-btn-elimina { background: #fef2f2; color: #dc2626; }

/* ── classi/lezione-form.ejs ───────────────────────────────── */
.lezione-form-header    { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.lezione-form-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--dot-color);
  flex-shrink: 0;
}
.lezione-form-title  { margin: 0; font-size: 1rem; }
.lezione-form-sub    { margin: 2px 0 0; color: var(--muted); font-size: .8rem; }

/* ── moduli/form.ejs ───────────────────────────────────────── */
.moduli-form-tip {
  font-size: .78rem;
  color: var(--muted);
  background: #f8fafc;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 4px;
}
.moduli-form-icon-preview     { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.moduli-form-icon-img         { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; }
.moduli-form-cover-preview    { width: 220px; height: 124px; border-radius: 8px; object-fit: cover; background: #000; }
.moduli-form-poster-preview   { width: 240px; aspect-ratio: 16/9; border-radius: 8px; object-fit: cover; display: block; }
.moduli-form-icon-remove-label{
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}
.moduli-form-file-input  { padding: 6px 12px; }
.moduli-form-color-row   { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.moduli-form-color-label { cursor: pointer; }
.moduli-form-radio-hidden{ display: none; }
.moduli-form-swatch-empty { background: #e2e8f0; border: 2px dashed #94a3b8; }

/* ── moduli/index.ejs ──────────────────────────────────────── */
.moduli-index-icon-img   { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.moduli-index-color-dot  { width: 12px; height: 12px; border-radius: 50%; background: var(--dot-color); flex-shrink: 0; }
.moduli-index-color-dot-empty { width: 12px; height: 12px; border-radius: 50%; background: #e2e8f0; flex-shrink: 0; }
.moduli-index-desc-small { font-size: .75rem; color: var(--muted); margin-top: 1px; }
.moduli-index-btn-elimina { background: #fef2f2; color: #dc2626; }
.moduli-index-btn-locked  { background: #f8fafc; color: var(--muted); cursor: default; }

/* ── moduli/dettaglio.ejs ──────────────────────────────────── */
.moduli-det-header-outer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.moduli-det-header-left  { display: flex; align-items: center; gap: 16px; }
.moduli-det-icon-img     { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.moduli-det-color-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--dot-color);
  flex-shrink: 0;
}
.moduli-det-title    { margin: 0; font-size: 1.05rem; font-weight: 700; }
.moduli-det-sub      { margin: 4px 0 0; color: var(--muted); font-size: .8rem; }
.moduli-det-desc     { margin: 6px 0 0; font-size: .82rem; color: var(--muted); }
.moduli-det-btn-row  { display: flex; gap: 8px; }
.moduli-det-grid     { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.moduli-det-td-link  { color: var(--primary); font-weight: 500; }
.moduli-det-td-muted { color: var(--muted); }
.moduli-det-orario   { font-size: .75rem; color: var(--muted); }

/* ── percorsi/form.ejs ─────────────────────────────────────── */
.percorsi-form-icon-preview { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.percorsi-form-icon-img     { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; }
.percorsi-form-icon-label   {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  cursor: pointer;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}
.percorsi-form-file-input   { padding: 6px 12px; }
.percorsi-form-moduli-list  { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.percorsi-form-add-row      { display: flex; gap: 8px; align-items: center; }
.percorsi-form-select       { flex: 1; }
.percorsi-form-row-name     { flex: 1; font-weight: 500; font-size: .875rem; }
.percorsi-form-btn-rimuovi  {
  background: #fef2f2;
  color: #dc2626;
  border: none;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: .78rem;
}

/* ── percorsi/index.ejs ────────────────────────────────────── */
.percorsi-index-name-cell  { display: flex; align-items: center; gap: 10px; }
.percorsi-index-icon-img   { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.percorsi-index-td-muted   { color: var(--muted); font-size: .82rem; }

/* ── percorsi/dettaglio.ejs ────────────────────────────────── */
.percorsi-det-header-outer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.percorsi-det-header-left  { display: flex; align-items: flex-start; gap: 14px; }
.percorsi-det-icon-img     { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }
.percorsi-det-title        { margin: 0; font-size: 1.1rem; }
.percorsi-det-nota         { margin: 4px 0 0; font-size: .82rem; color: var(--muted); }
.percorsi-det-desc         { margin: 4px 0 0; color: var(--muted); font-size: .85rem; }
.percorsi-det-token        {
  display: inline-block;
  margin-top: 6px;
  font-size: .75rem;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--muted);
}
.percorsi-det-btn-row      { display: flex; gap: 8px; }
.percorsi-det-td-ordine    { color: var(--muted); font-weight: 700; font-size: .85rem; }
.percorsi-det-td-ore       { color: var(--muted); font-size: .82rem; }
.percorsi-det-iscrivi-box  { padding: 16px; border-bottom: 1px solid var(--border); background: #f8fafc; }
.percorsi-det-iscrivi-row  { display: flex; gap: 8px; align-items: center; }
.percorsi-det-search-wrap  { position: relative; flex: 1; }
.percorsi-det-btn-iscrivi  { flex-shrink: 0; }
.percorsi-det-td-date      { font-size: .8rem; color: var(--muted); }
.percorsi-det-btn-rimuovi  { background: #fef2f2; color: #dc2626; }
.percorsi-det-th-qualifica { text-align: center; font-size: .78rem; white-space: nowrap; }
.percorsi-det-td-qualifica { text-align: center; }
.percorsi-qualifica-toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: .82rem; }
.percorsi-qualifica-toggle input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.qualifica-cb-label        { color: var(--muted); font-size: .78rem; min-width: 18px; }
.percorsi-qualifica-toggle:has(input:checked) .qualifica-cb-label { color: var(--accent); font-weight: 600; }

/* ── cicli/form.ejs ────────────────────────────────────────── */
.cicli-form-date-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── cicli/index.ejs ───────────────────────────────────────── */
.cicli-index-td-muted  { color: var(--muted); }
.cicli-index-btn-elimina { background: #fef2f2; color: #dc2626; }

/* ── Empty state emoji icon ────────────────────────────────── */
.empty-icon-lg { font-size: 2rem; }

/* ── esercizi/dettaglio.ejs ────────────────────────────────── */
.esercizi-det-card          { padding: 20px; margin-bottom: 20px; }
.esercizi-det-header        { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.esercizi-det-title-row     { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.esercizi-det-title         { margin: 0; font-size: 1.05rem; }
.esercizi-det-desc          { color: var(--muted); font-size: .85rem; margin: 0; }
.esercizi-det-links         { display: flex; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.esercizi-det-btn-group     { display: flex; gap: 8px; }
.esercizi-det-btn-elimina   { background: #fef2f2; color: #dc2626; }
.esercizi-det-version       { font-weight: 600; }
.esercizi-det-date          { color: var(--muted); font-size: .82rem; }
.esercizi-det-voto-emoji    { font-size: 1rem; }

/* ── esercizi/storico.ejs ───────────────────────────────────── */
.esercizi-stor-titolo        { font-size: 1rem; font-weight: 700; margin-bottom: 14px; }
.esercizi-stor-version-card  { margin-bottom: 16px; }
.esercizi-stor-consegna-block {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}
.esercizi-stor-section-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 8px;
}
.esercizi-stor-consegna-text  { margin: 0 0 10px; font-size: .9rem; }
.esercizi-stor-file-row       { display: flex; gap: 8px; flex-wrap: wrap; }
.esercizi-stor-correzione-block {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.esercizi-stor-voto-row       { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.esercizi-stor-voto-emoji     { font-size: 1.5rem; }
.esercizi-stor-voto-label     { font-weight: 700; font-size: 1rem; color: var(--voto-c, #6366f1); }
.esercizi-stor-form-block     { padding: 20px; }
.esercizi-stor-form-label-sm  {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 14px;
}
.esercizi-stor-voto-options   { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.esercizi-stor-radio-hidden   { display: none; }
.esercizi-stor-form-note      { font-weight: 400; text-transform: none; letter-spacing: 0; }
.esercizi-stor-file-input     { padding: 6px 12px; }
.esercizi-stor-submit-row     { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.esercizi-stor-back-link      { margin-top: 4px; }

/* ── admin/sicurezza.ejs ────────────────────────────────────── */
.sicurezza-header        { display: flex; align-items: center; justify-content: space-between; }
.sicurezza-badge-nuovo   { background: #fef3c7; color: #92400e; margin-left: 8px; font-size: .72rem; }
.sicurezza-btn-visti     { display: flex; align-items: center; gap: 6px; }
.sicurezza-td-ip         { font-family: monospace; font-size: .78rem; }
.sicurezza-td-device     { font-size: .8rem; color: var(--muted); }
.sicurezza-td-motivo     { font-size: .78rem; color: #dc2626; max-width: 260px; }
.sicurezza-td-data       { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.sicurezza-badge-tag     { background: #fef3c7; color: #92400e; font-size: .65rem; }

/* ── admin/utenti.ejs ───────────────────────────────────────── */
.utenti-list-filter-top     { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.utenti-list-btn-cerca      { padding: 9px 16px; font-size: .85rem; }
.utenti-list-btn-reset      { padding: 9px 14px; font-size: .85rem; }
.utenti-list-divider        { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.utenti-list-pill-attesa    { color: #b45309; border-color: #fde68a; }
.utenti-list-pill-in-corso  { color: #16a34a; border-color: #bbf7d0; }
.utenti-list-pill-alumni    { color: #7c3aed; border-color: #e9d5ff; }
.utenti-list-pill-disab     { color: #64748b; }
.utenti-list-pill-eliminati { color: #ef4444; }
.utenti-list-th-nome        { width: 36%; }
.utenti-list-td-data        { color: var(--muted); font-size: .8rem; }
.utenti-list-matricola      { font-size: .7rem; background: #f1f5f9; padding: 1px 6px; border-radius: 4px; margin-left: 6px; color: var(--muted); }
.utenti-list-btn-guest      { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.utenti-list-btn-percorso   { color: #7c3aed; }
.utenti-list-top-row        { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.utenti-list-btn-importa    { display: inline-flex; align-items: center; gap: 5px; }
.utenti-list-btn-importa svg { width: 14px; height: 14px; }

/* ── Importa utenti da Excel ─────────────────────────────── */
.importa-info-box {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  font-size: .84rem; line-height: 1.5; margin-bottom: 20px;
}
.importa-info-box svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; color: var(--muted); }
.importa-template-link { display: inline-flex; align-items: center; gap: 3px; }
.importa-template-link svg { width: 12px; height: 12px; }

.importa-counters { display: flex; gap: 14px; margin: 16px 0 20px; flex-wrap: wrap; }
.importa-counter {
  flex: 1; min-width: 100px;
  border-radius: var(--radius-sm); padding: 12px 16px;
  text-align: center;
}
.importa-counter-num   { display: block; font-size: 2rem; font-weight: 800; line-height: 1; }
.importa-counter-label { display: block; font-size: .78rem; margin-top: 4px; }
.importa-counter-label small { opacity: .7; }

.importa-counter-ok   { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.importa-counter-skip { background: #fffbeb; border: 1px solid #fde68a; color: #b45309; }
.importa-counter-err  { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; }

.importa-confirm-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.importa-confirm-txt { margin: 0; font-size: .9rem; }
.importa-confirm-btns { margin: 0; }

.importa-table-wrap { overflow-x: auto; margin-top: 16px; }
.importa-th-riga, .importa-td-riga { width: 48px; text-align: right; color: var(--muted); font-size: .75rem; }

.importa-tr-ok   td { }
.importa-tr-skip td { color: var(--muted); }
.importa-tr-err  td { color: #b91c1c; }

.importa-badge { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 600; padding: 2px 7px; border-radius: 4px; }
.importa-badge svg { width: 11px; height: 11px; }
.importa-badge-ok   { background: #dcfce7; color: #15803d; }
.importa-badge-skip { background: #fef9c3; color: #92400e; }
.importa-badge-err  { background: #fee2e2; color: #b91c1c; }

.importa-risultati-alert { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 14px; }
.importa-risultati-alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.importa-errori-list { margin: 6px 0 0; padding-left: 16px; }

@media (prefers-color-scheme: dark) {
  .classi-banner-section { background: #1a2035; border-color: #2e3f6e; }
  .importa-counter-ok   { background: rgba(21,128,61,.12);  border-color: rgba(21,128,61,.25);  color: #4ade80; }
  .importa-counter-skip { background: rgba(180,83,9,.12);   border-color: rgba(180,83,9,.25);   color: #fbbf24; }
  .importa-counter-err  { background: rgba(220,38,38,.12);  border-color: rgba(220,38,38,.25);  color: #f87171; }
  .importa-badge-ok     { background: rgba(21,128,61,.18);  color: #4ade80; }
  .importa-badge-skip   { background: rgba(180,83,9,.18);   color: #fbbf24; }
  .importa-badge-err    { background: rgba(220,38,38,.18);  color: #f87171; }
  .importa-tr-err td    { color: #f87171; }
}
:root[data-theme="dark"] {
  .classi-banner-section { background: #1a2035; border-color: #2e3f6e; }
  .importa-counter-ok   { background: rgba(21,128,61,.12);  border-color: rgba(21,128,61,.25);  color: #4ade80; }
  .importa-counter-skip { background: rgba(180,83,9,.12);   border-color: rgba(180,83,9,.25);   color: #fbbf24; }
  .importa-counter-err  { background: rgba(220,38,38,.12);  border-color: rgba(220,38,38,.25);  color: #f87171; }
  .importa-badge-ok     { background: rgba(21,128,61,.18);  color: #4ade80; }
  .importa-badge-skip   { background: rgba(180,83,9,.18);   color: #fbbf24; }
  .importa-badge-err    { background: rgba(220,38,38,.18);  color: #f87171; }
  .importa-tr-err td    { color: #f87171; }
}
:root[data-theme="light"] {
  .classi-banner-section { background: #f0f4ff; border-color: #d1dbfe; }
  .importa-counter-ok   { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
  .importa-counter-skip { background: #fffbeb; border: 1px solid #fde68a; color: #b45309; }
  .importa-counter-err  { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; }
  .importa-badge-ok     { background: #dcfce7; color: #15803d; }
  .importa-badge-skip   { background: #fef9c3; color: #92400e; }
  .importa-badge-err    { background: #fee2e2; color: #b91c1c; }
  .importa-tr-err td    { color: #b91c1c; }
}

/* ── partials/admin-top.ejs ─────────────────────────────────── */
.admin-top-footer-link { color: rgba(165, 180, 252, .7); font-size: .78rem; }

/* ── error.ejs ──────────────────────────────────────────────── */
.error-container { text-align: center; margin-top: 80px; }
.error-status    { font-size: 3rem; color: #4f46e5; margin: 0; }
.error-title     { color: #1e1b4b; margin: 12px 0 8px; }
.error-message   { color: #6b7280; }
.error-link      { color: #4f46e5; font-weight: 500; text-decoration: none; }

/* ── auth pages (login / register / forgot / reset) ─────────── */
.auth-alert-success   { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.auth-forgot-link-wrap { text-align: right; margin-top: 10px; }
.auth-forgot-link     { font-size: 0.8rem; color: #6b7280; text-decoration: none; }
.auth-required-star   { color: #dc2626; }
.auth-input-hint      { color: #6b7280; font-size: 0.78rem; margin-top: 4px; display: block; }
.auth-forgot-intro    { color: #6b7280; font-size: 0.875rem; margin: 0 0 20px; }

/* ── admin/utenti/profilo.ejs ───────────────────────────── */
/* Stat value accent colors */
.profilo-stat-value--indigo { color: #6366f1; }
.profilo-stat-value--purple { color: #7c3aed; }
.profilo-stat-value--green  { color: #10b981; }
.profilo-stat-value--orange { color: #f97316; }
.profilo-stat-value--violet { color: #8b5cf6; }
.profilo-stat-value--pink   { color: #ec4899; }

/* Testo secondario nelle stat */
.profilo-stat-facoltativo  { font-size: .62rem; color: var(--muted); }
.profilo-stat-no-tutoraggi { font-size: .68rem; color: var(--muted); }

/* Unità "gg" nella streak */
.profilo-streak-unit { font-size: .7rem; font-weight: 500; }

/* Form inline (reiscrivi in stato ritirato) */
.profilo-form-inline { display: inline; }
.profilo-form-inline[hidden] { display: none; }

/* Form cambio ruolo */
.profilo-form-ruolo { display: flex; gap: 6px; }

/* Griglia 2 colonne ripetuta nel profilo */
.profilo-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

/* Card dati anagrafici nel profilo */
.profilo-anagrafica-card { margin-top: 20px; }
.profilo-anagrafica-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 16px 18px;
}
.profilo-anagrafica-grid > div { padding-right: 24px; }
.profilo-anagrafica-grid > div + div {
  padding-left: 24px;
  padding-right: 0;
  border-left: 1px solid var(--border, #e5e7eb);
}
.profilo-anagrafica-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted, #6b7280);
  margin-bottom: 10px;
}
@media (max-width: 640px) {
  .profilo-anagrafica-grid { grid-template-columns: 1fr; }
  .profilo-anagrafica-grid > div + div { border-left: none; border-top: 1px solid var(--border, #e5e7eb); padding-left: 0; margin-top: 16px; padding-top: 16px; }
}

/* Colonna laterale (badge + percorsi) */
.profilo-side-col { display: flex; flex-direction: column; gap: 20px; }

/* Riga tabella accesso sospetto */
.profilo-accesso-sospetto td { background: #fef2f2; }

/* Celle tabella accessi */
.profilo-td-data        { font-size: .75rem; white-space: nowrap; }
.profilo-td-ip          { font-family: monospace; font-size: .72rem; }
.profilo-td-dispositivo { font-size: .75rem; color: var(--muted); }

/* Badge e icone accessi */
.profilo-badge-esito  { font-size: .65rem; }
.profilo-badge-stato  { font-size: .7rem; }
.profilo-sospetto-icon { color: #dc2626; font-size: .72rem; }

/* Wrapper grafico presenze mensili */
.profilo-chart-wrap { padding: 20px; }

/* Celle tabella esercizi */
.profilo-esercizio-titolo { font-weight: 500; font-size: .82rem; }
.profilo-esercizio-classe { font-size: .72rem; color: var(--muted); }
.profilo-td-voto          { font-size: 1rem; }
.profilo-td-versione      { color: var(--muted); font-size: .8rem; }

/* Celle tabella percorsi */
.profilo-percorso-nome   { font-weight: 500; font-size: .85rem; }
.profilo-percorso-moduli { color: var(--muted); font-size: .82rem; }

/* ── admin/utenti/cancella-dati.ejs (GDPR) ──────────────── */
.gdpr-warning-card {
  border-color: #dc2626 !important;
  background: #fef2f2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 24px 28px;
}
.gdpr-warning-icon { font-size: 2.5rem; line-height: 1; }
.gdpr-warning-title { font-size: 1.15rem; font-weight: 700; color: #dc2626; margin: 0; }
.gdpr-warning-desc { font-size: .9rem; color: #374151; margin: 0; }

.gdpr-list { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 8px; }
.gdpr-list-item { display: flex; align-items: flex-start; gap: 10px; font-size: .875rem; color: #374151; }
.gdpr-tag {
  flex-shrink: 0;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  margin-top: 1px;
}
.gdpr-tag--del  { background: #fee2e2; color: #b91c1c; }
.gdpr-tag--anon { background: #fef9c3; color: #92400e; }
.gdpr-count { font-size: .8rem; color: #6b7280; margin-left: 4px; }
.gdpr-kept-note {
  font-size: .8rem;
  color: #6b7280;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 4px;
}

.gdpr-confirm-desc { font-size: .9rem; color: var(--text-2); margin: 0 0 16px; line-height: 1.5; }
.gdpr-confirm-form { display: flex; flex-direction: column; gap: 14px; }

.gdpr-input-conferma {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .06em;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color .15s;
  font-family: inherit;
}
.gdpr-input-conferma:focus { border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220,38,38,.12); }
.gdpr-input-conferma::placeholder { color: var(--muted); font-weight: 400; letter-spacing: 0; }

.gdpr-btn-confirm {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.gdpr-btn-confirm:hover { background: #b91c1c; }

.form-error-msg {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .875rem;
  font-weight: 500;
}

/* ── admin/utenti/elimina-conferma.ejs ──────────────────── */
.elim-card {
  max-width: 560px; padding: 0; overflow: hidden;
  background: white; border-radius: 10px; border: 1px solid var(--border);
}

.elim-banner {
  background: #fef2f2; border-bottom: 2px solid #fecaca;
  padding: 20px 24px; display: flex; align-items: flex-start; gap: 14px;
}
.elim-banner-icon  { font-size: 2rem; flex-shrink: 0; }
.elim-banner-title { font-size: 1rem; font-weight: 800; color: #dc2626; margin-bottom: 4px; }
.elim-banner-text  { margin: 0; font-size: .875rem; color: #991b1b; line-height: 1.5; }

.elim-body { padding: 24px; }

.elim-utente-info {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 24px; padding: 16px;
  background: #f8fafc; border-radius: 10px; border: 1px solid var(--border);
}
.elim-utente-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: .9rem; flex-shrink: 0;
}
.elim-utente-nome    { font-weight: 700; font-size: 1rem; }
.elim-utente-email   { color: var(--muted); font-size: .82rem; }
.elim-utente-badges  { margin-top: 4px; display: flex; gap: 6px; }
.elim-utente-matricola {
  font-size: .68rem; background: #f1f5f9;
  padding: 1px 6px; border-radius: 4px; color: var(--muted);
}

.elim-blocco {
  background: #fef3c7; border: 1.5px solid #fde68a;
  border-radius: 10px; padding: 16px; margin-bottom: 20px;
}
.elim-blocco-title { font-weight: 700; color: #92400e; margin-bottom: 6px; }
.elim-blocco-text  { margin: 0; font-size: .875rem; color: #78350f; line-height: 1.5; }
.elim-blocco-nota  { margin: 10px 0 0; font-size: .82rem; color: #92400e; }

.elim-ok-text  { font-size: .88rem; color: var(--muted); margin-bottom: 20px; }
.elim-actions  { display: flex; justify-content: flex-end; gap: 10px; }

/* ── admin/utenti/iscrivi-classe.ejs ────────────────────── */
.iscr-stato-pills { display: flex; gap: 8px; margin-bottom: 12px; }

/* Form box padding */
.iscr-form-box { padding: 20px; margin-bottom: 16px; }

/* Griglia filtri iscrivi-classe */
.iscr-form-grid {
  display: grid;
  grid-template-columns: 1fr 160px 160px auto;
  gap: 10px;
  align-items: end;
}

/* Label filtri */
.iscr-label {
  display: block;
  font-size: .75rem; font-weight: 600;
  color: var(--muted); text-transform: uppercase;
  letter-spacing: .04em; margin-bottom: 5px;
}

/* Bottoni form ricerca */
.iscr-form-actions { display: flex; gap: 6px; }
.iscr-btn-cerca    { padding: 9px 16px; }
.iscr-btn-reset    { padding: 9px 12px; }

/* Colonna "Iscrivi" nella tabella */
.iscr-th-iscrivi { width: 240px; }

/* Cella nome classe con dot colore */
.iscr-classe-cell { display: flex; align-items: center; gap: 8px; }
.iscr-classe-dot  {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--dot-color, #e2e8f0); flex-shrink: 0;
}
.iscr-classe-nome { font-weight: 500; }
.iscr-classe-meta { font-size: .75rem; color: var(--muted); }

/* Celle data e orario */
.iscr-td-data    { font-size: .82rem; }
.iscr-td-orario  { font-size: .82rem; white-space: nowrap; }
.iscr-data-fine  { color: var(--muted); }
.iscr-muted      { color: var(--muted); }

.iscr-classe-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: .75rem; color: var(--muted); margin-top: 2px; }
.iscr-badge { display: inline-block; font-size: .68rem; font-weight: 600; letter-spacing: .03em; padding: 1px 6px; border-radius: 4px; }
.iscr-badge--elearning { background: #dbeafe; color: #1d4ed8; }
.iscr-badge--aziendale { background: #fef3c7; color: #92400e; }
@media (prefers-color-scheme: dark) {
  .iscr-badge--elearning { background: #1e3a5f; color: #93c5fd; }
  .iscr-badge--aziendale { background: #3b2a05; color: #fcd34d; }
}
:root[data-theme="light"] .iscr-badge--elearning { background: #dbeafe; color: #1d4ed8; }
:root[data-theme="light"] .iscr-badge--aziendale { background: #fef3c7; color: #92400e; }
:root[data-theme="dark"]  .iscr-badge--elearning { background: #1e3a5f; color: #93c5fd; }
:root[data-theme="dark"]  .iscr-badge--aziendale { background: #3b2a05; color: #fcd34d; }

/* Form iscrivi inline nella tabella */
.iscr-iscrivi-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.iscr-scadenza-input { width: 130px; font-size: .8rem; padding: 5px 8px; }
.iscr-scadenza-form { display: inline-flex; }
.iscr-scadenza-form .iscr-scadenza-input { width: 120px; font-size: .8rem; padding: 4px 6px; }

/* ── admin/utenti/iscrivi-percorso.ejs ──────────────────── */
/* Ricerca percorso */
.iscr-percorso-search { display: flex; gap: 8px; }

/* Empty state — percorsi già attivi */
.iscr-percorsi-attivi-intro { margin-bottom: 10px; }
.iscr-percorso-attivo-row {
  display: flex; align-items: center; gap: 8px;
  justify-content: center; margin-bottom: 4px;
}
.iscr-percorso-attivo-nome { font-size: .88rem; }
.iscr-percorso-attivo-data { font-size: .72rem; color: var(--muted); }
.iscr-percorsi-nota        { margin-top: 12px; font-size: .8rem; color: var(--muted); }

/* ── admin/utenti/disiscrivi-percorso.ejs ───────────────── */
.disiscr-percorso-riepilogo {
  padding: 20px 24px 24px;
  display: flex; flex-direction: column; gap: 8px;
}
.disiscr-percorso-nome {
  display: flex; align-items: center; gap: 8px;
  font-size: 1.1rem; font-weight: 700;
}
.disiscr-percorso-nome [data-lucide] { width: 20px; height: 20px; color: var(--primary); flex-shrink: 0; }
.disiscr-percorso-nota { font-size: .85rem; color: var(--muted); }
.disiscr-percorso-meta { display: flex; align-items: center; gap: 10px; font-size: .82rem; color: var(--muted); }

.disiscr-warn-icon { width: 16px; height: 16px; color: #d97706; vertical-align: -2px; margin-right: 4px; }
.disiscr-warning-note { margin: 0 24px 0; }

.disiscr-form-box { padding: 20px 24px 28px; }
.disiscr-no-classi { font-size: .88rem; color: var(--muted); margin-bottom: 20px; }

.disiscr-radio-group { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.disiscr-radio-option {
  display: flex; align-items: flex-start; gap: 12px;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 14px 16px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.disiscr-radio-option:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 5%, transparent); }
.disiscr-radio-option input[type="radio"] { margin-top: 3px; flex-shrink: 0; accent-color: var(--primary); }
.disiscr-radio-title { font-weight: 600; font-size: .88rem; margin-bottom: 3px; }
.disiscr-radio-desc  { font-size: .8rem; color: var(--muted); line-height: 1.4; }

.disiscr-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; padding-top: 4px; }
.disiscr-actions .btn-sm-danger-fill { display: flex; align-items: center; gap: 6px; }
.disiscr-actions .btn-sm-danger-fill [data-lucide] { width: 15px; height: 15px; }

/* ── admin/utenti/sposta-coorte.ejs ─────────────────────── */
/* Avatar initials nell'header sposta (sovrascrive dimensioni base) */
.sposta-avatar-initials { width: 44px; height: 44px; font-size: .9rem; }

/* Badge stato modulo */
.sposta-badge-completato   { background: #f0fdf4; color: #16a34a; }
.sposta-badge-ritirato     { background: #fef9c3; color: #854d0e; }
.sposta-badge-in-corso     { background: #eff6ff; color: #1d4ed8; }
.sposta-badge-non-iniziato { background: #f1f5f9; color: #64748b; }

/* Visibilità iniziale select nuova coorte (JS può sovrascrivere via style.display) */
.sposta-select-nuova { display: var(--sposta-display, none); }

/* Pulsanti azioni form */
.sposta-btn-annulla  { padding: 10px 24px; }
.sposta-btn-conferma { padding: 10px 24px; font-size: .9rem; }

/* ── staff-profilo-* (shared/profilo-staff.ejs) ─────────── */
.staff-profilo-wrap { max-width: 640px; }
.staff-profilo-card-mb { margin-bottom: 16px; }
.staff-profilo-card-body { padding: 20px; }
.staff-profilo-rimuovi-label {
  display: flex; align-items: center; gap: 5px;
  font-size: .75rem; margin: -8px 0 20px;
  cursor: pointer; color: var(--muted);
}
.staff-profilo-grid-2 {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 14px; margin-bottom: 14px;
}
.staff-profilo-hint { color: var(--muted); font-size: .75rem; margin-top: 3px; display: block; }
.staff-profilo-required { color: #dc2626; }
.staff-profilo-telefono { margin-top: 14px; }
.staff-profilo-prov-wrap { display: flex; gap: 6px; }
.staff-profilo-prov-input { width: 60px; }
.staff-profilo-google-note { font-size: .85rem; color: var(--muted); }
.staff-profilo-pwd-alert { margin-bottom: 14px; }
.staff-profilo-pwd-btn { padding: 8px 22px; font-size: .875rem; margin-top: 6px; }
.label-opt-sm { font-weight: 400; text-transform: none; letter-spacing: 0; }

/* ── doc-lezioni-* (docente/lezioni.ejs) ────────────────── */
.doc-lezioni-orario       { font-size: .75rem; color: var(--muted); }
.doc-lezioni-classe-wrap  { display: flex; align-items: center; gap: 7px; }
.doc-lezioni-colore-dot   {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--dot-color, var(--primary)); flex-shrink: 0;
}
.doc-lezioni-classe-nome  { font-weight: 500; font-size: .88rem; }
.doc-lezioni-docente-sub  { font-size: .72rem; color: var(--muted); margin-top: 2px; }
.doc-lezioni-presenti-num { font-weight: 600; }
.doc-lezioni-presenti-tot { color: var(--muted); font-size: .82rem; }
.doc-lezioni-dash         { color: var(--text-3); font-size: .82rem; }
.doc-lezioni-stato        { font-size: .72rem; }
.doc-lezioni-stato-chiuso { color: var(--muted); }
.doc-lezioni-stato-aperto { color: #16a34a; font-weight: 600; }
.doc-lezioni-stato-muted  { color: var(--muted); }

/* ── doc-classe-* (docente/classe.ejs) ──────────────────── */
.doc-classe-grid-2 {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 20px; align-items: start;
}
.doc-classe-grid-mt { margin-top: 20px; }
.doc-classe-row-passata { opacity: .5; }
.doc-classe-lezione-ora { font-size: .75rem; color: var(--muted); }
.doc-classe-presenti    { font-weight: 600; }
.doc-classe-btn-sm      { font-size: .75rem; }
.doc-table-actions      { display: flex; align-items: center; gap: 4px; }
.doc-inline-form        { display: inline; margin: 0; }
.doc-edit-row td        { padding: 12px 14px; background: var(--surface-2, #f8fafc); border-bottom: 1px solid var(--border); }
.doc-edit-form          { display: flex; flex-direction: column; gap: 0; }
.doc-edit-grid          { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.doc-edit-full          { grid-column: 1 / -1; }
.doc-classe-percorso-badge {
  font-size: .68rem; padding: 1px 7px; border-radius: 9px;
  background: #ede9fe; color: #7c3aed; font-weight: 500;
  display: inline-block; margin-top: 2px;
}
.doc-classe-badge-accesso { font-size: .7rem; }
.doc-classe-panel {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}
.doc-classe-panel-actions { display: flex; gap: 8px; }
.doc-classe-mat-titolo  { font-weight: 500; font-size: .85rem; }
.doc-classe-mat-tipo    { font-size: .78rem; color: var(--muted); }
.doc-classe-ex-tipo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.doc-classe-ex-titolo   { font-weight: 500; font-size: .85rem; }
.doc-classe-ex-scadenza { font-size: .72rem; color: var(--muted); }
.doc-classe-badge-xs    { font-size: .65rem; }

/* ── doc-bacheca-* (docente/bacheca.ejs) ────────────────── */
.doc-bacheca-compose-wrap { padding: 20px; margin-bottom: 20px; }
.doc-bacheca-textarea    { resize: vertical; min-height: 80px; margin-bottom: 10px; }
.doc-bacheca-file-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.doc-bacheca-toolbar     { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.doc-bacheca-tools       { display: flex; gap: 6px; }
.doc-bacheca-messages    { padding: 16px 20px; display: flex; flex-direction: column; gap: 16px; }
.doc-bacheca-msg-body    { flex: 1; min-width: 0; }
.doc-bacheca-msg-meta    { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.doc-bacheca-msg-nome    { font-weight: 700; font-size: .88rem; }
.doc-bacheca-badge-sm    { font-size: .65rem; }
.doc-bacheca-msg-time    { font-size: .72rem; color: var(--muted); }
.doc-bacheca-allegati    { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.doc-bacheca-qualifica-row { margin-bottom: 8px; }
.doc-bacheca-qualifica-label { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; cursor: pointer; }
.doc-bacheca-qualifica-label svg { width: 13px; height: 13px; }
.badge-qualifica-msg { display: inline-flex; align-items: center; gap: 3px; font-size: .65rem; font-weight: 700; background: rgba(139,92,246,.15); color: #7c3aed; border-radius: 4px; padding: 1px 5px; }
.badge-qualifica-msg svg { width: 10px; height: 10px; }

.msg-edit-btn, .msg-delete-btn { background: none; border: none; cursor: pointer; font-size: 1rem; opacity: .55; padding: 0 3px; transition: opacity .15s; }
.msg-edit-btn:hover   { opacity: 1; }
.msg-delete-btn { color: #dc2626; font-weight: 700; }
.msg-delete-btn:hover { opacity: 1; }
.msg-edited              { font-size: .68rem; color: var(--muted); font-style: italic; }
.msg-edit-form           { margin-top: 4px; }
.msg-edit-textarea       { display: block; width: 100%; box-sizing: border-box; border: solid 1px #6ee7b7; background: none; resize: vertical; font-family: inherit; font-size: .9rem; padding: 8px; min-height: 84px; color: var(--text); }
.msg-edit-textarea:focus { outline: none; }
.msg-edit-divider        { border-top: 1px solid var(--border); margin: 8px 0; }
.msg-edit-actions        { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.msg-edit-error          { font-size: .76rem; color: #dc2626; margin-right: auto; }
.msg-edit-cancel         { font-size: .8rem; color: var(--muted); background: none; border: none; cursor: pointer; }
.msg-edit-cancel:hover   { color: var(--text); }
.msg-edit-save           { font-size: .8rem; font-weight: 600; background: var(--primary); color: white; border: none; border-radius: 6px; padding: 5px 14px; cursor: pointer; }
.msg-edit-save:hover     { opacity: .88; }

/* ── doc-sel-classe-* (docente/seleziona-classe.ejs) ─────── */
.doc-sel-classe-wrap  { max-width: 520px; padding: 28px; }
.doc-sel-classe-title { margin: 0 0 6px; font-size: 1.05rem; }
.doc-sel-classe-sub   { color: var(--muted); font-size: .85rem; margin: 0 0 20px; }
.doc-sel-classe-list  { display: flex; flex-direction: column; gap: 10px; }
.doc-sel-classe-item  {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border: 1.5px solid var(--border); border-radius: 10px;
  text-decoration: none; color: var(--text);
  transition: all .18s;
}
.doc-sel-classe-item:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.doc-sel-classe-nome       { font-weight: 700; font-size: .92rem; }
.doc-sel-classe-sottotitolo { font-size: .75rem; color: var(--muted); }
.doc-sel-classe-arrow      { margin-left: auto; color: var(--muted); }

/* ── doc-studenti-* (docente/studenti-classe.ejs) ───────── */
.doc-studenti-title { margin: 0; font-size: .95rem; }

/* ── hdr-corso-* (partials/header-corso.ejs) ────────────── */
.hdr-corso-wrap   { padding: 20px; margin-bottom: 16px; }
.hdr-corso-inner  { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.hdr-corso-left   { display: flex; align-items: center; gap: 12px; }
.hdr-corso-nome   { margin: 0; font-size: 1.05rem; }
.hdr-corso-meta   { margin: 4px 0 0; color: var(--muted); font-size: .82rem; }
.hdr-corso-stato-badge { font-size: .7rem; margin-left: 6px; }
.hdr-corso-azioni { display: flex; gap: 8px; }

/* ── Compose toolbar (correzione esercizi, richtext) ────── */
.richtext-compose { display: flex; flex-direction: column; }
.richtext-compose .admin-input { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom: none; resize: vertical; }
.richtext-compose .compose-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border: 1px solid var(--border);
  border-top: none; border-bottom-left-radius: 7px; border-bottom-right-radius: 7px;
  background: var(--surface-2);
}
.richtext-compose .compose-tools { display: flex; gap: 4px; }
.richtext-file-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px; background: var(--primary-soft);
  border: 1.5px solid var(--primary); border-radius: 8px;
  font-size: .78rem; color: var(--primary);
  margin-top: 6px; max-width: 100%; overflow: hidden;
}
.richtext-file-chip .file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.richtext-file-chip .file-size { flex-shrink: 0; color: var(--muted); }
.richtext-file-remove {
  background: none; border: none; cursor: pointer; color: var(--muted);
  font-size: .9rem; padding: 0 2px; line-height: 1; flex-shrink: 0;
}
.richtext-file-remove:hover { color: #dc2626; }
.tool-btn-attach--selected { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }

/* ── Utilities ──────────────────────────────────────────── */
.u-hidden           { display: none !important; }
.u-display-contents { display: contents; }
.u-flex-gap-8       { display: flex; gap: 8px; }
.u-mt-8             { margin-top: 8px; }
.u-mt-12            { margin-top: 12px; }
.u-mt-24            { margin-top: 24px; }
.u-mb-8             { margin-bottom: 8px; }
.u-mb-16            { margin-bottom: 16px; }
.u-ml-auto          { margin-left: auto; }
.u-m-0              { margin: 0 !important; }
.u-mw-160           { max-width: 160px; }
.u-mw-200           { max-width: 200px; }
.u-mw-280           { max-width: 280px; }
.u-mw-380           { max-width: 380px; }
.u-mw-680           { max-width: 680px; }
.u-w-160            { width: 160px; }
.u-uppercase        { text-transform: uppercase; }
.u-monospace        { font-family: monospace; letter-spacing: .08em; }
.u-text-sm          { font-size: .8rem; }
.u-text-xs          { font-size: .82rem; color: var(--text-muted); margin-left: 8px; }
.u-offscreen        { position: absolute; left: -9999px; }

/* Piani rate row (admin/utenti/profilo) */
.admin-rate-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.admin-rate-meta   { font-size: .82rem; color: var(--text-muted); margin-left: 8px; }
.admin-rate-ritardo { color: #dc2626; font-weight: 600; }

/* Richiesta iscrizione (admin/iscrizioni/richiesta) */
.iscrizione-nota-sm    { font-size: .85rem; margin: 0; }
.iscrizione-codice     { text-transform: uppercase; font-family: monospace; letter-spacing: .08em; }

/* ── Videolezioni on demand (admin/moduli/dettaglio + admin/videolezioni/form) ── */
.vod-list-title-row  { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vod-list-no-video   { font-size: .72rem; color: #dc2626; margin-top: 2px; }

.vod-badge-pillola, .vod-badge-intro, .vod-badge-vtt, .vod-badge-pre-corso {
  display: inline-block; flex-shrink: 0;
  font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  border-radius: 4px; padding: 1px 6px;
}
.vod-badge-pillola   { color: #d97706; background: #fef3c7; }
.vod-badge-intro     { color: #0369a1; background: #e0f2fe; }
.vod-badge-vtt       { color: #15803d; background: #dcfce7; }
.vod-badge-pre-corso { color: #0369a1; background: #e0f2fe; font-size: .7rem; }

.vod-form-breadcrumb { font-size: .83rem; color: var(--muted); margin-bottom: 1rem; }
.vod-form-breadcrumb a { color: var(--primary); text-decoration: none; }
.vod-form-hint { font-size: .75rem; color: var(--muted); margin-top: .25rem; }

/* ── Conferma eliminazione video ──────────────────────────── */
.vod-del-header       { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem; }
.vod-del-icon         { color: #b45309; flex-shrink: 0; margin-top: 2px; }
.vod-del-title        { font-size: 1.2rem; font-weight: 700; margin: 0 0 .25rem; }
.vod-del-sub          { margin: 0; color: var(--muted); font-size: .95rem; }
.vod-del-sub strong   { color: var(--text); }

.vod-del-warning {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.vod-del-warning-title { margin: 0 0 .75rem; font-size: .92rem; }
.vod-del-classi-table  { width: 100%; border-collapse: collapse; font-size: .85rem; }
.vod-del-classi-table th { text-align: left; padding: .35rem .5rem; color: var(--muted); font-weight: 600; border-bottom: 1px solid #fcd34d; }
.vod-del-classi-table td { padding: .4rem .5rem; border-bottom: 1px solid #fde68a; }
.vod-del-classi-table a  { color: var(--primary); text-decoration: none; }
.vod-del-classi-table tr:last-child td { border-bottom: none; }

.vod-del-info {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .85rem 1.1rem;
  font-size: .9rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}
.vod-del-confirm-box  { border-top: 1px solid var(--border); padding-top: 1.25rem; margin-top: .5rem; }
.vod-del-confirm-text { font-size: .9rem; color: var(--muted); margin: 0 0 1rem; }
.vod-del-confirm-text strong { color: var(--text); }
.vod-del-actions      { display: flex; gap: .75rem; align-items: center; }

@media (prefers-color-scheme: dark) {
  .vod-del-icon    { color: #fbbf24; }
  .vod-del-warning { background: #1c1506; border-color: #713f12; }
  .vod-del-classi-table th { border-color: #713f12; }
  .vod-del-classi-table td { border-color: #3b2001; }
}
:root[data-theme="dark"] .vod-del-icon    { color: #fbbf24; }
:root[data-theme="dark"] .vod-del-warning { background: #1c1506; border-color: #713f12; }
:root[data-theme="dark"] .vod-del-classi-table th { border-color: #713f12; }
:root[data-theme="dark"] .vod-del-classi-table td { border-color: #3b2001; }
:root[data-theme="light"] .vod-del-icon    { color: #b45309; }
:root[data-theme="light"] .vod-del-warning { background: #fffbeb; border-color: #fcd34d; }
:root[data-theme="light"] .vod-del-classi-table th { border-color: #fcd34d; }
:root[data-theme="light"] .vod-del-classi-table td { border-color: #fde68a; }
.vod-form-cover-preview { display: flex; align-items: center; gap: 1rem; margin-bottom: .5rem; }
.vod-form-cover-img     { width: 80px; height: 50px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); }
.vod-form-cover-remove  { font-size: .8rem; color: var(--muted); cursor: pointer; display: flex; align-items: center; gap: .35rem; }
.vod-form-vtt-row       { display: flex; align-items: center; gap: 1rem; margin-bottom: .5rem; font-size: .83rem; }
.vod-form-vtt-present   { color: #15803d; font-weight: 500; }
.vod-form-sommario-ai   { font-size: .83rem; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: .75rem 1rem; white-space: pre-wrap; }
.vod-ai-label-row       { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .35rem; }
.vod-ai-label-row label { margin-bottom: 0; }
.vod-ai-hint            { font-size: .78rem; color: var(--muted); }

/* Badge stato AI — riusato anche nella form videolezioni */
.reg-ai-badge { display: inline-flex; align-items: center; font-size: .72rem; font-weight: 600; padding: .18rem .55rem; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.reg-ai-badge--completato     { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.reg-ai-badge--in_elaborazione{ background: #fef9c3; color: #713f12; border-color: #fde68a; }
.reg-ai-badge--da_generare    { background: #f3f4f6; color: #374151; border-color: #e5e7eb; }
.reg-ai-badge--errore         { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.reg-ai-badge--manuale        { background: #ede9fe; color: #4c1d95; border-color: #c4b5fd; }
@media (prefers-color-scheme: dark) {
  .reg-ai-badge--completato     { background: #064e3b; color: #6ee7b7; border-color: #065f46; }
  .reg-ai-badge--in_elaborazione{ background: #44260b; color: #fde68a; border-color: #713f12; }
  .reg-ai-badge--da_generare    { background: #1f2937; color: #9ca3af; border-color: #374151; }
  .reg-ai-badge--errore         { background: #450a0a; color: #fca5a5; border-color: #7f1d1d; }
  .reg-ai-badge--manuale        { background: #2e1065; color: #c4b5fd; border-color: #4c1d95; }
}
:root[data-theme="dark"]  .reg-ai-badge--completato     { background: #064e3b; color: #6ee7b7; border-color: #065f46; }
:root[data-theme="dark"]  .reg-ai-badge--in_elaborazione{ background: #44260b; color: #fde68a; border-color: #713f12; }
:root[data-theme="dark"]  .reg-ai-badge--da_generare    { background: #1f2937; color: #9ca3af; border-color: #374151; }
:root[data-theme="dark"]  .reg-ai-badge--errore         { background: #450a0a; color: #fca5a5; border-color: #7f1d1d; }
:root[data-theme="dark"]  .reg-ai-badge--manuale        { background: #2e1065; color: #c4b5fd; border-color: #4c1d95; }
:root[data-theme="light"] .reg-ai-badge--completato     { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
:root[data-theme="light"] .reg-ai-badge--in_elaborazione{ background: #fef9c3; color: #713f12; border-color: #fde68a; }
:root[data-theme="light"] .reg-ai-badge--da_generare    { background: #f3f4f6; color: #374151; border-color: #e5e7eb; }
:root[data-theme="light"] .reg-ai-badge--errore         { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
:root[data-theme="light"] .reg-ai-badge--manuale        { background: #ede9fe; color: #4c1d95; border-color: #c4b5fd; }

/* ── VOD Timeline (class detail video box) ────────────────── */
.vod-timeline { border-top: 1px solid var(--border); }

.vod-lezione-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  gap: 8px;
}
.vod-lezione-info    { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1; }
.vod-lezione-data    { font-size: .85rem; }
.vod-lezione-ora     { font-size: .78rem; color: var(--text-muted); }
.vod-lezione-futura  { font-size: .78rem; color: var(--text-muted); font-style: italic; }
.vod-lezione-parti   { font-size: .78rem; color: var(--text-muted); }
.vod-lezione-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.vod-timeline--dragging .vod-lezione-row { cursor: copy; border-left: 3px solid transparent; transition: background .1s, border-left-color .1s; }
.vod-lezione-row--active { background: #eff6ff !important; border-left-color: var(--primary) !important; }
.vod-timeline--dragging .vod-lezione-row > *,
.vod-timeline--dragging .vod-slot > * { pointer-events: none; }

/* Drop slots between lessons */
.vod-slot {
  min-height: 6px;
  background: #f8fafc;
  border-bottom: 1px solid #eef1f6;
  transition: min-height .12s, background .12s, border-left .12s;
  border-left: 3px solid transparent;
}
.vod-timeline--dragging .vod-slot {
  min-height: 38px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.vod-slot--active {
  background: #eff6ff;
  border-left-color: var(--primary);
}

.vod-slot-hint {
  display: none;
  font-size: .72rem;
  color: var(--text-muted);
  padding: 0 16px;
  pointer-events: none;
}
.vod-timeline--dragging .vod-slot-hint { display: block; }

/* Pill / intro rows inside slots */
.vod-pill-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 20px;
  background: var(--surface);
  border-bottom: 1px solid #f1f5f9;
  border-left: 3px solid #fbbf24;
  user-select: none;
  cursor: grab;
}
.vod-pill-row[data-tipo="intro"]  { border-left-color: #38bdf8; }
.vod-pill-row.vod-pill-dragging   { opacity: .35; }

.vod-drag-handle {
  cursor: grab;
  color: var(--text-muted);
  font-size: .95rem;
  user-select: none;
  flex-shrink: 0;
  line-height: 1;
}
.vod-drag-handle:active { cursor: grabbing; }
.vod-pill-nome { font-size: .85rem; font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vod-pill-arg  { font-size: .78rem; color: var(--text-muted); flex-shrink: 0; }

/* VOD modal body */
.modale-vod-body { padding: 4px 15px; max-height: 420px; overflow-y: auto; }
.vod-modal-empty-btn { text-align: center; padding: 8px 0 16px; }
.vod-modal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.vod-modal-row:last-child { border-bottom: none; }
.vod-modal-info { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.vod-modal-arg  { font-size: .78rem; color: var(--text-muted); }

/* ── Classi form: sezioni aziendale / regionale ─────────── */
.classi-form-section {
  margin-top: 24px;
  padding: 20px 22px;
  background: var(--surface-2, rgba(0,0,0,.03));
  border: 1px solid var(--border);
  border-radius: 10px;
}
:root[data-theme="dark"] .classi-form-section,
@media (prefers-color-scheme: dark) { .classi-form-section { background: rgba(255,255,255,.04); } }
.classi-form-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .9rem;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--text);
}
.classi-form-section-title svg { width: 16px; height: 16px; color: var(--primary); flex-shrink: 0; }
.classi-logo-preview { margin-bottom: 10px; }
.classi-logo-img { max-height: 60px; max-width: 200px; border-radius: 6px; border: 1px solid var(--border); object-fit: contain; padding: 6px; background: #fff; }
.classi-azienda-logo { margin-top: 8px; }
.classi-banner-img { width: 100%; max-width: 420px; aspect-ratio: 2/1; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); display: block; margin-bottom: 8px; }
.classi-logo-upload-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.classi-logo-msg { margin-top: 8px; font-size: .82rem; font-weight: 600; padding: 6px 10px; border-radius: 6px; background: var(--surface-2); color: var(--text-muted); }
.classi-logo-msg--ok  { background: #f0fdf4; color: #16a34a; }
.classi-logo-msg--err { background: #fef2f2; color: #dc2626; }

/* Badge aziendale / regionale nella lista classi e nel dettaglio */
.badge-aziendale  { display: inline-flex; align-items: center; gap: 4px; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; background: #ede9fe; color: #6d28d9; border: 1px solid #ddd6fe; white-space: nowrap; }
.badge-regionale  { display: inline-flex; align-items: center; gap: 4px; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; background: #fef9c3; color: #a16207; border: 1px solid #fde68a; white-space: nowrap; }
:root[data-theme="dark"] .badge-aziendale  { background: #3b1f6e; color: #c4b5fd; border-color: #5b3fa8; }
:root[data-theme="dark"] .badge-regionale  { background: #4a3c00; color: #fde68a; border-color: #a16207; }
.badge-aziendale svg, .badge-regionale svg { width: 11px; height: 11px; }

/* Info regionale nel dettaglio classe */
.classe-reg-info { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 12px; }
.classe-reg-field { font-size: .82rem; }
.classe-reg-label { font-weight: 600; color: var(--text-muted); display: block; margin-bottom: 2px; }

/* Con-qualifica toggle in tabella studenti */
.qualifica-toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: .8rem; }
.qualifica-toggle input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; accent-color: var(--primary); }

/* ── Corsi Regionali — griglia catalogo ─────────────────── */
.cr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; padding: 20px; }
.cr-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.cr-card-logo { height: 56px; display: flex; align-items: center; }
.cr-logo-img { max-height: 56px; max-width: 160px; object-fit: contain; }
.cr-logo-placeholder { width: 48px; height: 48px; border-radius: 8px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.cr-logo-placeholder svg { width: 22px; height: 22px; }
.cr-card-body { flex: 1; }
.cr-card-nome { font-weight: 700; font-size: .95rem; margin-bottom: 6px; }
.cr-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.cr-pill { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 600; padding: 2px 7px; border-radius: 20px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.cr-pill svg { width: 11px; height: 11px; }
.cr-pill-percorsi { color: #7c3aed; background: rgba(124,58,237,.08); border-color: rgba(124,58,237,.2); }
.cr-card-note { font-size: .8rem; color: var(--muted); margin: 0; }
.cr-card-actions { display: flex; gap: 8px; align-items: center; }
.cr-btn-elimina { background: none; border: 1px solid #fca5a5; color: #dc2626; padding: 5px 12px; border-radius: 6px; font-size: .8rem; cursor: pointer; }
.cr-btn-elimina:hover { background: #fef2f2; }
.cr-rimuovi-logo-label { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; cursor: pointer; margin-bottom: 8px; }

/* ── Azienda — pagina eliminazione ──────────────────────── */
.az-elimina-header      { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.az-elimina-logo        { width: 56px; height: 56px; object-fit: contain; border-radius: 8px; background: #f8fafc; padding: 6px; border: 1px solid var(--border); }
.az-elimina-titolo      { font-size: 1.25rem; font-weight: 700; margin: 0 0 6px; }
.az-elimina-avviso      { display: flex; align-items: center; gap: 6px; color: #b45309; font-size: .88rem; margin: 0; }
.az-elimina-avviso svg  { width: 16px; height: 16px; flex-shrink: 0; }
.az-elimina-classi-box  { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 16px; margin-bottom: 20px; }
.az-elimina-classi-titolo { font-size: .88rem; margin: 0 0 12px; }
.az-elimina-table       { width: 100%; border-collapse: collapse; font-size: .85rem; }
.az-elimina-table th,
.az-elimina-table td    { padding: 6px 10px; text-align: left; border-bottom: 1px solid #fde68a; }
.az-elimina-table th    { font-weight: 600; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.az-elimina-no-classi   { color: var(--muted); font-size: .88rem; margin-bottom: 16px; }
.az-elimina-label       { font-size: .9rem; font-weight: 600; }
.az-elimina-input       { font-family: monospace; font-size: 1rem; letter-spacing: .05em; max-width: 260px; }
.az-elimina-btn-confirm { background: #dc2626; color: #fff; border: none; display: inline-flex; align-items: center; gap: 6px; }
.az-elimina-btn-confirm:hover { background: #b91c1c; }
.az-elimina-form        { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }

@media (prefers-color-scheme: dark) {
  .az-elimina-avviso    { color: #fbbf24; }
  .az-elimina-classi-box { background: rgba(251,191,36,.08); border-color: rgba(251,191,36,.25); }
  .az-elimina-table th,
  .az-elimina-table td  { border-color: rgba(251,191,36,.2); }
}
:root[data-theme="dark"] {
  .az-elimina-avviso    { color: #fbbf24; }
  .az-elimina-classi-box { background: rgba(251,191,36,.08); border-color: rgba(251,191,36,.25); }
  .az-elimina-table th,
  .az-elimina-table td  { border-color: rgba(251,191,36,.2); }
}
:root[data-theme="light"] {
  .az-elimina-avviso    { color: #b45309; }
  .az-elimina-classi-box { background: #fffbeb; border-color: #fde68a; }
}

/* ── Info regionale nel dettaglio Percorso ──────────────── */
.percorso-reg-info { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.percorso-reg-field { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; color: var(--muted); }
.percorso-reg-field svg { width: 12px; height: 12px; }
.percorso-reg-attesa { color: #b45309; font-style: italic; }

@media (prefers-color-scheme: dark) {
  .cr-btn-elimina { border-color: rgba(220,38,38,.4); color: #f87171; }
  .cr-btn-elimina:hover { background: rgba(220,38,38,.1); }
}
:root[data-theme="dark"] {
  .cr-btn-elimina { border-color: rgba(220,38,38,.4); color: #f87171; }
  .cr-btn-elimina:hover { background: rgba(220,38,38,.1); }
}
:root[data-theme="light"] {
  .cr-btn-elimina { background: none; border: 1px solid #fca5a5; color: #dc2626; }
}

/* ── Utility spacing ── */
.mt-section { margin-top: 1.5rem; margin-bottom: 1.5rem; }

/* ── E-learning riepilogo in dettaglio classe ── */
.el-classe-riepilogo {
  display: flex;
  gap: 2rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.el-classe-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 64px;
}
.el-classe-stat-val {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
}
.el-classe-stat-label {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: .25rem;
}
.el-classe-nota {
  padding: .75rem 1.25rem;
  font-size: .875rem;
  color: var(--text-muted);
  margin: 0;
}

/* ══════════════════════════════════════════════════════════════
   E-LEARNING — componenti admin (moduli tipo elearning)
   ══════════════════════════════════════════════════════════════ */

/* ── Tipo modulo (form crea/modifica) ── */
.moduli-form-tipo-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}
.moduli-form-tipo-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.moduli-form-tipo-opt:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}
.moduli-form-tipo-opt input[type="radio"] {
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--accent);
}
.moduli-form-tipo-opt span { display: flex; flex-direction: column; gap: 2px; }
.moduli-form-tipo-opt strong { font-size: .875rem; }
.moduli-form-tipo-opt small { font-size: .78rem; color: var(--muted); }

/* ── Lista sezioni (capitoli) nel dettaglio modulo ── */
.el-sezione-block {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
}
.el-sezione-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface-2, color-mix(in srgb, var(--surface) 60%, transparent));
}
.el-sezione-num {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  flex-shrink: 0;
  min-width: 32px;
}
.el-sezione-info { flex: 1; min-width: 0; }
.el-sezione-titolo { font-size: .9rem; font-weight: 600; }
.el-sezione-desc { font-size: .78rem; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.el-sezione-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ── Lista lezioni dentro la sezione ── */
.el-lezioni-list { padding: 4px 0; }
.el-lezioni-empty{padding:2px 14px }
.el-lezione-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px 9px 28px;
  border-top: 1px solid var(--border);
}
.el-lezione-row:first-child { border-top-color: var(--border); }
.el-lez-num { font-size: .72rem; color: var(--muted); flex-shrink: 0; min-width: 24px; font-variant-numeric: tabular-nums; }
.el-lez-info { flex: 1; min-width: 0; }
.el-lez-titolo { font-size: .85rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.el-lez-meta { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.el-lez-durata { font-size: .72rem; color: var(--muted); }
.el-lez-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

/* ── Link "Aggiungi video" ── */
.el-add-lezione {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  color: var(--accent);
  padding: 8px 14px 8px 28px;
  border-top: 1px dashed var(--border);
  width: 100%;
  text-decoration: none;
  transition: background .12s;
}
.el-add-lezione:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.el-add-lezione i { width: 14px; height: 14px; }

/* ── Form nuova sezione ── */
.el-nuova-sezione-form {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-top: 4px;
}
.el-nuova-sezione-title { font-size: .82rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }
.el-nuova-sezione-fields { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.el-nuova-sezione-fields .admin-input { flex: 1; min-width: 180px; }

/* ── Modal modifica sezione ── */
.el-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.el-modal-overlay.open { display: flex; }
.el-modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
}
.el-modal-title { font-size: 1rem; font-weight: 700; margin-bottom: 16px; }

/* ── Form lezione (upload VTT) ── */
.el-form-durata-input { max-width: 160px; }
.el-form-vtt-existing {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.el-form-vtt-name { font-size: .8rem; color: var(--muted); font-family: monospace; }
.el-form-vtt-remove { font-size: .78rem; color: var(--danger, #ef4444); cursor: pointer; }

/* ── Badge stato sommario AI lezione ── */
.el-ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 2px 7px;
  border-radius: 99px;
  border: 1px solid;
}
.el-ai-badge-coda    { color: #92400e; background: #fef3c7; border-color: #fde68a; }
.el-ai-badge-elabora { color: #1d4ed8; background: #dbeafe; border-color: #93c5fd; }
.el-ai-badge-ok      { color: #166534; background: #dcfce7; border-color: #86efac; }
.el-ai-badge-errore  { color: #991b1b; background: #fee2e2; border-color: #fca5a5; }

@media (prefers-color-scheme: dark) {
  .el-sezione-head { background: color-mix(in srgb, var(--surface) 80%, #000 20%); }
  .el-ai-badge-coda    { color: #fbbf24; background: rgba(251,191,36,.12); border-color: rgba(251,191,36,.3); }
  .el-ai-badge-elabora { color: #60a5fa; background: rgba(96,165,250,.12); border-color: rgba(96,165,250,.3); }
  .el-ai-badge-ok      { color: #4ade80; background: rgba(74,222,128,.12); border-color: rgba(74,222,128,.3); }
  .el-ai-badge-errore  { color: #f87171; background: rgba(248,113,113,.12); border-color: rgba(248,113,113,.3); }
}
:root[data-theme="dark"] {
  .el-sezione-head { background: color-mix(in srgb, var(--surface) 80%, #000 20%); }
  .el-ai-badge-coda    { color: #fbbf24; background: rgba(251,191,36,.12); border-color: rgba(251,191,36,.3); }
  .el-ai-badge-elabora { color: #60a5fa; background: rgba(96,165,250,.12); border-color: rgba(96,165,250,.3); }
  .el-ai-badge-ok      { color: #4ade80; background: rgba(74,222,128,.12); border-color: rgba(74,222,128,.3); }
  .el-ai-badge-errore  { color: #f87171; background: rgba(248,113,113,.12); border-color: rgba(248,113,113,.3); }
}
:root[data-theme="light"] {
  .el-sezione-head { background: #f8f9fa; }
}

/* ── Quiz per capitolo ── */
.el-quiz-row {
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 97%, var(--accent) 3%);
}
.el-quiz-exists { display: flex; align-items: center; gap: 8px; }
.el-quiz-genera-form { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.el-quiz-label { font-size: .75rem; color: var(--muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.el-quiz-storico { font-size: .72rem; color: var(--muted); font-style: italic; }
.el-quiz-sep { color: var(--border); }
.el-quiz-rigenera-form { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border); }
.el-quiz-err { font-size: .75rem; color: #dc2626; margin-left: 6px; }
.admin-select-sm {
  font-size: .78rem;
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

/* ── Sommario AI lezione (admin form) ── */
.el-sommario-admin-box {}
.el-sommario-stato-row { display: flex; align-items: center; gap: 8px; }
.el-sommario-no-vtt { font-size: .75rem; color: var(--muted); font-style: italic; }
.el-sommario-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.el-sommario-table th { text-align: left; padding: 6px 12px; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border); }
.el-sommario-table td { padding: 6px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.el-sommario-ts { font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 600; white-space: nowrap; width: 60px; }
.el-sommario-attesa { padding: 16px 20px; color: var(--muted); font-size: .85rem; }
.el-sommario-errore { padding: 12px 20px; color: #dc2626; font-size: .85rem; }

/* ── Referenti classe (dettaglio classe) ─────────────────────── */
.rc-box           { }
.rc-heading       { display: flex; align-items: center; gap: 6px; margin-bottom: 0; }
.rc-heading-icon  { width: 15px; height: 15px; flex-shrink: 0; }
.rc-hint          { padding: 4px 20px 12px; font-size: .82rem; color: var(--muted); }
.rc-list          { display: flex; flex-direction: column; gap: 0; padding: 0 20px 8px; }
.rc-item          { }
.rc-label         { display: flex; align-items: center; gap: 10px; padding: 8px 0;
                    border-bottom: 1px solid var(--border); cursor: pointer; }
.rc-item:last-child .rc-label { border-bottom: none; }
.rc-checkbox      { width: 16px; height: 16px; accent-color: var(--primary); flex-shrink: 0; cursor: pointer; }
.rc-name          { font-size: .88rem; font-weight: 500; }
.rc-email         { font-size: .78rem; color: var(--muted); margin-left: auto; }
.rc-footer-hint   { padding: 8px 20px 16px; font-size: .78rem; color: var(--muted); }
.rc-footer-hint a { color: var(--accent); text-decoration: none; }
.rc-footer-hint a:hover { text-decoration: underline; }

/* ── Referenti aziendali (form azienda) ──────────────────────── */
.az-ref-container  { margin-top: 24px; }
.az-ref-heading    { margin-bottom: 0; display: flex; align-items: center; gap: 6px; }
.az-ref-heading-icon { width: 16px; height: 16px; flex-shrink: 0; }
.az-ref-hint       { padding: 0 20px 12px; font-size: .85rem; color: var(--muted); }
.az-ref-alert      { margin: 0 20px 12px; }
.az-ref-empty      { padding: 0 20px 16px; font-size: .85rem; color: var(--muted); }
.az-ref-muted      { color: var(--muted); font-size: .85rem; }
.az-ref-table      { margin-bottom: 20px; }
.az-ref-add-form   { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 0 20px 20px; }
.az-ref-email-input { flex: 1; min-width: 260px; }
.az-ref-plus-icon  { width: 14px; height: 14px; flex-shrink: 0; vertical-align: -2px; }

/* ── Form a pagina intera (slide login, ecc.) ────────────────── */
.form-page {
  max-width: 680px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  margin-bottom: 28px;
}
.back-link:hover { text-decoration: underline; }
.back-link [data-lucide] { width: 14px; height: 14px; flex-shrink: 0; }

.admin-form { display: flex; flex-direction: column; gap: 28px; }

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 600px) { .form-row-2 { grid-template-columns: 1fr; } }

.form-fieldset {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin: 0;
}
.form-fieldset-title {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 6px;
}

.form-hint {
  font-size: .78rem;
  color: var(--muted);
  margin: 2px 0 0;
}

.form-input-file {
  font-size: .85rem;
  color: var(--text);
  cursor: pointer;
}

.media-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
  padding: 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.media-preview img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.media-preview-label {
  font-size: .8rem;
  color: var(--muted);
}

.radio-group { display: flex; flex-direction: column; gap: 10px; }
.radio-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  font-size: .875rem;
}
.radio-option:hover { border-color: var(--primary); background: #f5f3ff; }
.radio-option input[type="radio"] { accent-color: var(--primary); flex-shrink: 0; }
.radio-option [data-lucide] { width: 15px; height: 15px; color: var(--muted); vertical-align: -2px; margin-right: 2px; }

.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-size: .875rem;
  margin-top: 6px;
}
.toggle-label input[type="checkbox"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.toggle-text { color: var(--text); }

.required { color: #dc2626; }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.btn-outline:hover { background: var(--surface); border-color: #94a3b8; }

.slide-testo-preview {
  font-size: .78rem;
  color: var(--muted);
  margin-top: 2px;
}

.row-muted { opacity: .55; }
.td-center { text-align: center; }
.text-muted { color: var(--muted); }

.td-actions--row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.td-actions--row .btn-sm,
.td-actions--row [class^="btn-sm"] {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.td-actions--row [data-lucide] {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}
