:root {
  --blu: #1a56db;
  --blu-scuro: #1e3a8a;
  --verde: #16a34a;
  --rosso: #dc2626;
  --grigio: #6b7280;
  --grigio-chiaro: #f3f4f6;
  --bordo: #e5e7eb;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  background: var(--grigio-chiaro);
  color: #111827;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px;
}

header {
  background: var(--blu-scuro);
  color: white;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 { font-size: 18px; margin: 0; }

.crediti-badge {
  background: rgba(255,255,255,0.15);
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
}

.crediti-badge.zero { background: var(--rosso); }

.card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.card h2 {
  font-size: 15px;
  margin: 0 0 12px 0;
  color: var(--grigio);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #374151;
}

input[type="text"],
input[type="password"],
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--bordo);
  border-radius: 8px;
  font-size: 15px;
  margin-bottom: 14px;
}

input[type="file"] { margin-bottom: 14px; }

button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  width: 100%;
  margin-bottom: 8px;
}

.btn-primario { background: var(--blu); color: white; }
.btn-primario:hover { background: var(--blu-scuro); }

.btn-secondario { background: var(--grigio-chiaro); color: #111827; border: 1px solid var(--bordo); }

.btn-azione { background: #111827; color: white; }
.btn-azione:hover { background: #000; }

button:disabled { opacity: 0.5; cursor: not-allowed; }

.azioni-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.messaggio {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 14px;
}

.messaggio.ok { background: #dcfce7; color: #166534; }
.messaggio.errore { background: #fee2e2; color: #991b1b; }
.messaggio.info { background: #dbeafe; color: #1e40af; }

.dati-box {
  background: var(--grigio-chiaro);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 14px;
}

.screenshot { width: 100%; border-radius: 8px; border: 1px solid var(--bordo); margin-top: 8px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--bordo); }
th { color: var(--grigio); font-weight: 600; }

.badge-esito { padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-esito.successo { background: #dcfce7; color: #166534; }
.badge-esito.errore { background: #fee2e2; color: #991b1b; }

.hidden { display: none !important; }

#schermata-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#schermata-login .card { width: 100%; max-width: 380px; }

.logout-link {
  color: white;
  text-decoration: none;
  font-size: 13px;
  opacity: 0.8;
  margin-left: 12px;
}
