:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #667085;
  --border: #d9e1ec;
  --primary: #1769e0;
  --primary-dark: #0e4faa;
  --danger: #b42318;
  --success: #067647;
  --shadow: 0 16px 42px rgba(31, 47, 75, .10);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #edf4ff 0, var(--bg) 280px);
}
.container { width: min(1040px, calc(100% - 32px)); margin: 40px auto; }
.hero { margin-bottom: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .02em; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--primary); color: white; display: grid; place-items: center; }
h1 { margin: 16px 0 8px; font-size: clamp(28px, 4vw, 44px); line-height: 1.08; }
.lead { color: var(--muted); font-size: 18px; max-width: 760px; line-height: 1.6; }
.card { background: var(--card); border: 1px solid rgba(217,225,236,.9); border-radius: 20px; box-shadow: var(--shadow); padding: 28px; }
.section-title { margin: 0 0 18px; font-size: 20px; }
.section { padding: 6px 0 26px; margin-bottom: 22px; border-bottom: 1px solid #edf0f5; }
.section:last-of-type { border-bottom: 0; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.full { grid-column: 1 / -1; }
label, legend { display: block; font-weight: 700; font-size: 14px; margin-bottom: 7px; }
.required::after { content: " *"; color: var(--danger); }
input, select, textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 12px 13px;
  font: inherit; color: var(--text); background: #fff; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(23,105,224,.13); }
textarea { min-height: 150px; resize: vertical; }
.help { color: var(--muted); font-size: 12px; margin-top: 6px; line-height: 1.45; }
.choice-row { display: flex; flex-wrap: wrap; gap: 12px; }
.choice { display: inline-flex; align-items: center; gap: 8px; padding: 10px 13px; border: 1px solid var(--border); border-radius: 10px; font-weight: 600; background: #fff; }
.choice input { width: auto; margin: 0; }
.actions { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; }
button, .button { border: 0; border-radius: 11px; padding: 13px 20px; font: inherit; font-weight: 800; cursor: pointer; text-decoration: none; display: inline-block; }
button.primary, .button.primary { color: white; background: var(--primary); }
button.primary:hover, .button.primary:hover { background: var(--primary-dark); }
.button.secondary { background: #eef3fa; color: #25334d; }
.alert { padding: 14px 16px; border-radius: 12px; margin: 0 0 20px; line-height: 1.5; }
.alert.error { background: #fff1f0; color: var(--danger); border: 1px solid #fecdca; }
.alert.success { background: #ecfdf3; color: var(--success); border: 1px solid #abefc6; }
.alert ul { margin: 8px 0 0 20px; padding: 0; }
.honeypot { position: absolute !important; left: -9999px !important; opacity: 0 !important; }
.small { font-size: 13px; color: var(--muted); }
.ticket-code { font-size: clamp(28px,5vw,48px); font-weight: 900; letter-spacing: .04em; margin: 18px 0; color: var(--primary); }
.admin-top { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:20px; }
.filters { display:grid; grid-template-columns: 1.2fr .7fr .7fr auto; gap:10px; margin-bottom:18px; }
table { width:100%; border-collapse:collapse; font-size:14px; }
th, td { padding:12px 10px; border-bottom:1px solid #e8edf4; text-align:left; vertical-align:top; }
th { color:#475467; font-size:12px; text-transform:uppercase; letter-spacing:.04em; }
.badge { display:inline-block; padding:4px 8px; border-radius:999px; background:#eef3fa; font-size:12px; font-weight:800; white-space:nowrap; }
.badge.NUOVO { background:#eaf2ff; color:#175cd3; }
.badge.IN_ANALISI { background:#fff7e6; color:#b54708; }
.badge.ATTESA_CLIENTE { background:#f4f3ff; color:#5925dc; }
.badge.RISOLTO { background:#ecfdf3; color:#067647; }
.badge.CHIUSO { background:#f2f4f7; color:#344054; }
.detail-list { display:grid; grid-template-columns: 220px 1fr; gap:0; }
.detail-list dt, .detail-list dd { margin:0; padding:10px 0; border-bottom:1px solid #edf0f5; }
.detail-list dt { font-weight:800; color:#475467; }
pre.description { white-space:pre-wrap; font:inherit; margin:0; }
@media (max-width: 760px) {
  .container { width:min(100% - 20px, 1040px); margin:20px auto; }
  .card { padding:20px; border-radius:16px; }
  .grid, .filters { grid-template-columns:1fr; }
  .full { grid-column:auto; }
  .detail-list { grid-template-columns:1fr; }
  .detail-list dt { padding-bottom:2px; border-bottom:0; }
  .detail-list dd { padding-top:2px; }
  .table-wrap { overflow-x:auto; }
}
