:root {
  --navy: #0e2849;
  --blue: #318aca;
  --paper: #f1f5f9;
  --surface: #ffffff;
  --border: #e2e8f0;
  --muted: #5b6b73;
  --accent: #C0392B;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--navy);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
header.app-header {
  background: linear-gradient(135deg, var(--navy), #1c3d66);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  box-shadow: 0 6px 16px rgba(14,40,73,0.14);
}
header.app-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
}
header.app-header .brand img { height: 32px; }
header.app-header nav { display: flex; gap: 4px; flex-wrap: wrap; }
header.app-header nav a {
  color: rgba(255,255,255,0.88);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.15s ease;
}
header.app-header nav a:hover { background: rgba(255,255,255,0.14); color: #fff; }
header.app-header .utente { display: flex; align-items: center; gap: 10px; font-size: 13px; }
header.app-header .utente a {
  color: #fff; background: rgba(255,255,255,0.12);
  padding: 6px 11px; border-radius: 8px; text-decoration: none;
}
main { max-width: 900px; margin: 0 auto; padding: 24px 16px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(14,40,73,0.06);
}
.page-title { color: var(--navy); font-size: 22px; margin-bottom: 4px; }
.sub { color: var(--muted); font-size: 13px; margin-top: 0; }
label.field { display: block; margin-bottom: 14px; }
label.field span.label-text {
  display: block; font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.02em; margin-bottom: 4px;
}
input[type="text"], input[type="password"], input[type="email"], input[type="number"], textarea, select {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--navy);
}
textarea { resize: vertical; min-height: 70px; }
.btn {
  display: inline-block; padding: 10px 18px; border-radius: 8px; border: none;
  font-size: 14px; font-weight: 700; cursor: pointer; text-decoration: none;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(49,138,202,0.35); }
.btn-ghost { background: var(--paper); color: var(--navy); border: 1px solid var(--border); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { display: block; width: 100%; text-align: center; }
table.tabella-dati { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tabella-dati th {
  background: var(--navy); color: #fff; text-align: left; padding: 10px 12px; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.03em;
}
table.tabella-dati td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
table.tabella-dati tr:nth-child(even) { background: var(--paper); }
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge-attesa { background: #fbe9e7; color: var(--accent); }
.badge-ok { background: #e3f5e9; color: #1b7a4c; }
.flash {
  padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; font-weight: 600;
}
.flash-success { background: #e3f5e9; color: #1b7a4c; }
.flash-error { background: #fbe9e7; color: var(--accent); }
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 90vh; }
.login-box { background: #fff; border-radius: 12px; padding: 36px; width: 100%; max-width: 380px; text-align: center; box-shadow: 0 10px 30px rgba(14,40,73,0.12); }
.login-box img { height: 70px; margin-bottom: 12px; }
.empty { text-align: center; color: var(--muted); padding: 30px; font-size: 13px; }

.logo-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  flex: none;
}
.logo-avatar img { width: 20px; height: 20px; object-fit: contain; }
.logo-avatar-grande {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #fff;
  margin: 0 auto 10px;
  box-shadow: 0 2px 8px rgba(14,40,73,0.12);
}
.logo-avatar-grande img { width: 52px; height: 52px; object-fit: contain; }
