/* ============================================================
   Variabili e reset
   ============================================================ */
:root {
  --fg: #0f172a;
  --muted: #64748b;
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e2e8f0;
  --accent: #4f46e5;
  --accent-2: #7c3aed;
  --accent-hover: #4338ca;
  --ok: #065f46;
  --ok-bg: #ecfdf5;
  --err: #991b1b;
  --err-bg: #fef2f2;
  --shadow: 0 4px 6px -1px rgba(15,23,42,.06), 0 2px 4px -2px rgba(15,23,42,.06);
  --shadow-lg: 0 20px 40px -12px rgba(15,23,42,.15);
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #a855f7 100%);
  color: #fff;
  padding: 4rem 1.5rem 5rem;
  text-align: center;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px circle at 20% 30%, rgba(255,255,255,.18), transparent 45%),
    radial-gradient(500px circle at 80% 70%, rgba(255,255,255,.12), transparent 45%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  max-width: 780px;
  margin: 0 auto;
  z-index: 2;
}
.hero-badge {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(8px);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-bottom: 1.2rem;
  border: 1px solid rgba(255,255,255,.25);
}
.hero h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.9rem);
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}
.hero h1 span {
  background: linear-gradient(90deg, #fde68a, #fbbf24);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  font-size: 1.05rem;
  line-height: 1.65;
  color: rgba(255,255,255,.9);
  max-width: 620px;
  margin: 0 auto;
}
.hero-cta { margin-top: 1.5rem; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: rgba(255,255,255,.95);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
}
.hero-wave {
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 60px;
}
.hero-wave svg { display: block; width: 100%; height: 100%; }

/* ============================================================
   Layout principale
   ============================================================ */
main {
  max-width: 980px;
  margin: -2.5rem auto 0;
  padding: 0 1.2rem 3rem;
  position: relative;
  z-index: 3;
}

/* ============================================================
   Alert
   ============================================================ */
.alert {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.95rem 1.1rem;
  border-radius: 12px;
  margin: 0 0 1.5rem;
  box-shadow: var(--shadow);
  animation: slideIn .3s ease-out;
}
.alert svg { flex-shrink: 0; margin-top: 0.15rem; }
.alert.ok  { background: var(--ok-bg);  color: var(--ok);  border: 1px solid #a7f3d0; }
.alert.err { background: var(--err-bg); color: var(--err); border: 1px solid #fecaca; }
.alert ul { margin: 0; padding-left: 1.1rem; }

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Welcome card (utente loggato)
   ============================================================ */
.welcome-card {
  display: flex;
  gap: 1.3rem;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem 1.8rem;
  box-shadow: var(--shadow-lg);
}
.welcome-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px; height: 54px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}
.welcome-card h2 { margin: 0 0 0.4rem; font-size: 1.3rem; }
.welcome-card p  { margin: 0 0 1.1rem; color: var(--muted); }

/* ============================================================
   Steps
   ============================================================ */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 0 0 1.8rem;
}
.step {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem 1.2rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}
.step:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.7rem;
}
.step h3 { margin: 0 0 0.35rem; font-size: 1rem; }
.step p  { margin: 0; font-size: 0.9rem; color: var(--muted); }

/* ============================================================
   Grid a due colonne (registrazione + login)
   ============================================================ */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

/* ============================================================
   Card
   ============================================================ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem 1.6rem 1.4rem;
  box-shadow: var(--shadow);
  transition: box-shadow .2s ease;
}
.card:hover { box-shadow: var(--shadow-lg); }

.card-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.3rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: #eef2ff;
  color: var(--accent);
  flex-shrink: 0;
}
.card-icon.accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}
.card-head h2 { margin: 0; font-size: 1.15rem; }
.card-head .muted { margin: 0.15rem 0 0; font-size: 0.88rem; color: var(--muted); }

/* ============================================================
   Form
   ============================================================ */
label {
  display: block;
  margin-top: 1rem;
  margin-bottom: 0.35rem;
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--fg);
}
label.check {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-weight: 400;
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 1.1rem;
  line-height: 1.5;
}
label.check input {
  margin-top: 0.2rem;
  flex-shrink: 0;
  accent-color: var(--accent);
  width: 16px; height: 16px;
}

.input-wrap {
  position: relative;
}
.input-wrap svg {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  transition: color .2s ease;
}
.input-wrap input {
  width: 100%;
  padding: 0.75rem 0.9rem 0.75rem 2.6rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 0.98rem;
  background: #f8fafc;
  color: var(--fg);
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
  font-family: inherit;
}
.input-wrap input::placeholder { color: #94a3b8; }
.input-wrap input:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(79,70,229,.12);
}
.input-wrap input:focus + svg,
.input-wrap:focus-within svg { color: var(--accent); }

/* ============================================================
   Bottoni
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  border: none;
  border-radius: 10px;
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
}
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 4px 14px rgba(79,70,229,.35);
}
.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79,70,229,.45);
}
.btn.primary:active { transform: translateY(0); }
.btn.ghost {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.btn.ghost:hover { background: rgba(79,70,229,.06); }
.btn.block { width: 100%; margin-top: 1.3rem; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

/* ============================================================
   Supporto
   ============================================================ */
.support {
  margin: 1.3rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
}
.support a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.support a:hover { text-decoration: underline; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  text-align: center;
  padding: 2rem 1rem 2.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 820px) {
  .grid-2 { grid-template-columns: 1fr; }
  .steps  { grid-template-columns: 1fr; gap: 0.7rem; }
  .step   { padding: 1rem; display: flex; align-items: center; gap: 1rem; text-align: left; }
  .step-num { margin-bottom: 0; flex-shrink: 0; }
  .hero { padding: 3rem 1.2rem 4rem; }
  .hero-sub { font-size: 0.98rem; }
  main { margin-top: -2rem; }
}

@media (max-width: 480px) {
  .welcome-card { flex-direction: column; padding: 1.3rem; }
  .card { padding: 1.3rem; }
  .hero h1 { font-size: 1.7rem; }
}
/* ============================================================
   Area riservata — Hero compatto
   ============================================================ */
.hero-compact {
  padding: 3rem 1.5rem 4rem;
}
.hero-compact h1 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); }
.hero-compact .hero-sub { font-size: 1rem; }

/* ============================================================
   Barra utente
   ============================================================ */
.user-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.2rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}
.user-info {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}
.avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.user-name {
  font-weight: 600;
  font-size: 0.98rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 40ch;
}
.user-role {
  font-size: 0.82rem;
  color: var(--muted);
}
.user-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.btn.sm {
  padding: 0.5rem 0.9rem;
  font-size: 0.88rem;
  margin-top: 0;
}
.btn.danger {
  background: transparent;
  color: #dc2626;
  border: 1.5px solid #fecaca;
}
.btn.danger:hover { background: #fef2f2; border-color: #dc2626; }

/* ============================================================
   Toolbar ricerca + conteggio
   ============================================================ */
.files-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}
.files-count {
  font-size: 0.95rem;
  color: var(--muted);
}
.files-count strong {
  color: var(--fg);
  font-size: 1.15rem;
  margin-right: 0.2rem;
}
.search-wrap {
  position: relative;
  flex: 1 1 260px;
  max-width: 340px;
}
.search-wrap svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.search-wrap input {
  width: 100%;
  padding: 0.65rem 0.9rem 0.65rem 2.5rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  font-size: 0.95rem;
  color: var(--fg);
  font-family: inherit;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.search-wrap input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(79,70,229,.12);
}

/* ============================================================
   Griglia file
   ============================================================ */
.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.file-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.file-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: #c7d2fe;
}

.file-icon {
  position: relative;
  flex-shrink: 0;
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ic, var(--accent));
  background: color-mix(in srgb, var(--ic, var(--accent)) 12%, #ffffff);
}
/* Fallback per browser senza color-mix */
@supports not (background: color-mix(in srgb, red 10%, white)) {
  .file-icon { background: #eef2ff; }
}
.file-ext {
  position: absolute;
  bottom: -6px;
  right: -6px;
  background: var(--ic, var(--accent));
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.12rem 0.4rem;
  border-radius: 6px;
  border: 2px solid var(--card);
}

.file-body {
  flex: 1;
  min-width: 0;
}
.file-name {
  font-weight: 600;
  font-size: 0.94rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.15rem;
}
.file-meta {
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.file-meta .dot { opacity: 0.5; }

.file-dl {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(79,70,229,.3);
  transition: transform .12s ease, box-shadow .2s ease;
}
.file-dl:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(79,70,229,.45);
}
.file-dl:active { transform: translateY(0); }

/* Nasconde il testo "Scarica" su schermi molto stretti */
@media (max-width: 360px) {
  .file-dl span { display: none; }
  .file-dl { padding: 0.5rem 0.6rem; }
}

/* ============================================================
   Empty state
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 84px; height: 84px;
  border-radius: 20px;
  background: linear-gradient(135deg, #eef2ff, #f5f3ff);
  color: var(--accent);
  margin-bottom: 1.2rem;
}
.empty-state h2 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
}
.empty-state p {
  max-width: 460px;
  margin: 0 auto 1.4rem;
  color: var(--muted);
}
.empty-state .btn { margin-top: 0; }

.empty-filter {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}
/* ============================================================
   Responsive area riservata
   ============================================================ */
@media (max-width: 560px) {
  .user-bar { padding: 0.8rem 1rem; }
  .user-actions .btn { padding: 0.45rem 0.7rem; font-size: 0.82rem; }
  .files-toolbar { flex-direction: column; align-items: stretch; }
  .search-wrap { max-width: none; }
  .file-card { padding: 0.9rem 1rem; gap: 0.8rem; }
  .file-icon { width: 46px; height: 46px; }
  .file-icon svg { width: 26px; height: 26px; }
  .hero-compact { padding: 2.5rem 1.2rem 3.5rem; }
}
/* ============================================================
   Breadcrumb
   ============================================================ */
.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem;
  font-size: 0.9rem; margin: 0 0 1.2rem;
}
.crumbs a {
  color: var(--accent); text-decoration: none; font-weight: 500;
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.25rem 0.55rem; border-radius: 6px;
  transition: background .15s ease;
}
.crumbs a:hover { background: rgba(79,70,229,.08); }
.crumb-sep { color: var(--muted); }
.crumb-current { color: var(--fg); font-weight: 600; padding: 0.25rem 0.2rem; }

/* ============================================================
   Griglia cartelle
   ============================================================ */
.folders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.4rem;
}
.folder-card {
  display: flex; align-items: center; gap: 0.7rem;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.85rem 1rem;
  text-decoration: none; color: var(--fg);
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease;
}
.folder-card:hover {
  transform: translateY(-2px); box-shadow: var(--shadow-lg);
  border-color: #c7d2fe;
}
.folder-icon {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px;
  background: #fef3c7; color: #d97706; flex-shrink: 0;
}
.folder-name {
  flex: 1; min-width: 0; font-weight: 600; font-size: 0.93rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.folder-arrow { color: var(--muted); flex-shrink: 0; }

@media (max-width: 480px) {
  .folders-grid { grid-template-columns: 1fr; }
}
/* ============================================================
   Pannello admin
   ============================================================ */
.hero-badge.admin {
  background: rgba(245,158,11,.25);
  border-color: rgba(245,158,11,.55);
}
/* Statistiche */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  box-shadow: var(--shadow);
}
.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.1;
}
.stat-label {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.25rem;
  font-weight: 500;
}
/* Tabs */
.admin-tabs {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
}
.admin-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.1rem;
  border-radius: 10px 10px 0 0;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.94rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color .15s ease, background .15s ease;
}
.admin-tab:hover { color: var(--fg); background: rgba(0,0,0,.02); }
.admin-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: #fff;
}
/* Upload */
.upload-card {
  background: var(--card);
  border: 1.5px dashed var(--accent);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  margin-bottom: 1.2rem;
}
.upload-head {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  margin-bottom: 1rem;
}
.upload-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.upload-card h3 { margin: 0; font-size: 1.05rem; }
.upload-card .muted { margin: 0.15rem 0 0; font-size: 0.85rem; color: var(--muted); }
.upload-form { display: flex; gap: 0.7rem; align-items: center; flex-wrap: wrap; }
.upload-form input[type="file"] {
  flex: 1 1 260px;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  font-size: 0.9rem;
}
.upload-form .btn { margin-top: 0; }
/* Crea cartella */
.folder-actions { margin-bottom: 1.2rem; }
.inline-form { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.inline-form input[type="text"] {
  flex: 1 1 200px;
  max-width: 320px;
  padding: 0.55rem 0.8rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.92rem;
  font-family: inherit;
}
.inline-form input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(79,70,229,.12);
}
.inline-form .btn { margin-top: 0; }

/* Card cartella admin (link + bottone elimina) */
.folder-card { position: relative; padding: 0; }
.folder-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1rem;
  padding-right: 2.3rem;
  text-decoration: none;
  color: var(--fg);
}
.btn-folder-del {
  position: absolute;
  top: 8px; right: 8px;
  width: 26px; height: 26px;
  border-radius: 6px;
  border: none;
  background: rgba(220,38,38,.08);
  color: #dc2626;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s ease, background .15s ease;
}
.folder-card:hover .btn-folder-del { opacity: 1; }
.btn-folder-del:hover { background: #dc2626; color: #fff; }

/* Azioni file admin */
.file-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
  align-items: center;
}
.file-actions form { margin: 0; padding: 0; display: inline; }
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent); }
.btn-icon.danger:hover { border-color: #dc2626; color: #dc2626; background: #fef2f2; }

/* Intestazione utenti */
.users-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}
.users-header h2 { margin: 0; font-size: 1.25rem; }

/* Tabella utenti */
.users-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  font-size: 0.92rem;
}
.users-table th,
.users-table td {
  padding: 0.8rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.users-table th {
  background: #f8fafc;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.users-table tr:last-child td { border-bottom: none; }
.users-table tr:hover td { background: #f8fafc; }
.users-table .email { color: var(--muted); font-size: 0.88rem; }
.users-table form { margin: 0; }

.badge-admin {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
@media (max-width: 560px) {
  .users-table th,
  .users-table td { padding: 0.6rem 0.7rem; font-size: 0.85rem; }
  .users-table th:nth-child(1),
  .users-table td:nth-child(1),
  .users-table th:nth-child(4),
  .users-table td:nth-child(4) { display: none; }
  .admin-tab { padding: 0.6rem 0.85rem; font-size: 0.88rem; }
}