:root {
  --navy: #1f2a4d;
  --navy-d: #16203c;
  --navy-l: #2c3b66;
  --gold: #e6c200;
  --gold-d: #c19b16;
  --ink: #1a2230;
  --ink-dim: #5d6b80;
  --line: #e3e7ee;
  --bg: #eef1f6;
  --card: #ffffff;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--bg); font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }

/* ---------- LOGIN ---------- */
#login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(900px 500px at 50% -10%, #2c3b66, var(--navy-d));
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 340px; background: var(--card);
  border-radius: 16px; padding: 30px 26px; text-align: center;
  box-shadow: 0 20px 50px #0b132799;
}
.logo-lg { width: 74px; height: 74px; margin-bottom: 6px; }
.login-card h1 { margin: 2px 0 0; font-size: 21px; color: var(--navy); }
.login-card .sub { margin: 3px 0 20px; font-size: 13px; color: var(--ink-dim); }
.login-card input {
  width: 100%; padding: 11px 12px; margin-bottom: 10px;
  border: 1px solid #cdd4e0; border-radius: 9px; font-size: 14px;
}
.login-card input:focus { outline: none; border-color: var(--navy-l); box-shadow: 0 0 0 3px #2c3b6633; }
.login-card button { width: 100%; margin-top: 4px; }
.err-msg { color: #c0392b; font-size: 13px; min-height: 16px; margin: 10px 0 0; }

/* ---------- CONSOLE ---------- */
#console header {
  display: flex; align-items: center; gap: 12px;
  background: var(--navy); color: #fff; padding: 12px 20px;
  box-shadow: 0 2px 8px #16203c40;
}
.logo-sm { width: 36px; height: 36px; }
.htxt { display: flex; flex-direction: column; line-height: 1.2; }
.htxt strong { font-size: 16px; }
.htxt span { font-size: 12px; color: #aebbd6; }
#console header .ghost { margin-left: auto; }

main { max-width: 860px; margin: 22px auto; padding: 0 18px; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 18px; margin-bottom: 16px;
  box-shadow: 0 1px 3px #1f2a4d0f;
}
.card.primario { border-top: 3px solid var(--gold); }
.card-head { display: flex; align-items: center; justify-content: space-between; }
h2 { margin: 0 0 4px; font-size: 16px; color: var(--navy); }
.hint { margin: 0 0 12px; font-size: 13px; color: var(--ink-dim); }
.riga { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.riga input { flex: 1; min-width: 160px; }

input, select {
  padding: 10px 11px; border: 1px solid #cdd4e0; border-radius: 9px;
  font-size: 14px; background: #fff; color: var(--ink);
}
input:focus, select:focus { outline: none; border-color: var(--navy-l); box-shadow: 0 0 0 3px #2c3b6622; }

button {
  padding: 10px 16px; border: 0; border-radius: 9px; cursor: pointer;
  background: var(--gold); color: var(--navy-d); font-weight: 700; font-size: 14px;
  transition: filter .12s, transform .06s;
}
button:hover { filter: brightness(1.06); }
button:active { transform: translateY(1px); }
button.ghost { background: transparent; color: #fff; border: 1px solid #ffffff55; font-weight: 600; }
#console main button.ghost { color: var(--navy); border-color: #cdd4e0; }
button.ghost:hover { filter: none; background: #ffffff1a; }
#console main button.ghost:hover { background: #f1f3f8; }

table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
th { text-align: left; padding: 9px 8px; color: var(--ink-dim); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; border-bottom: 2px solid var(--line); }
td { padding: 10px 8px; border-bottom: 1px solid var(--line); }
tbody tr:hover { background: #f7f9fc; }
td code { background: #eef1f6; padding: 2px 6px; border-radius: 5px; font-size: 12px; }
td button { padding: 5px 10px; font-size: 12px; background: #fbeaea; color: #c0392b; }

pre {
  background: var(--navy-d); color: #e7edf7; padding: 13px 14px; border-radius: 10px;
  font-size: 13px; line-height: 1.55; white-space: pre-wrap; margin: 12px 0 0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
pre:empty { display: none; }
.avanzato summary { cursor: pointer; font-weight: 600; color: var(--navy); font-size: 14px; }
.avanzato[open] summary { margin-bottom: 12px; }
