:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --ink: #1f2933;
  --muted: #6b7280;
  --line: #e2e8f0;
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --ok: #047857;
  --warn: #b45309;
  --new: #1d4ed8;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.brand { font-weight: 700; font-size: 1.15rem; text-decoration: none; color: var(--ink); }
.topbar nav { display: flex; align-items: center; gap: 1rem; margin-left: auto; flex-wrap: wrap; }
.topbar nav a { text-decoration: none; color: var(--accent); }
.who { color: var(--muted); font-size: 0.9rem; }
.container { max-width: 880px; margin: 1.5rem auto; padding: 0 1rem; }
h1 { font-size: 1.5rem; margin: 0 0 0.75rem; }
h3 { margin: 1.25rem 0 0.4rem; }
.muted { color: var(--muted); }
.error { color: #b91c1c; background: #fee2e2; padding: 0.5rem 0.75rem; border-radius: 6px; }
.success { color: var(--ok); background: #d1fae5; padding: 0.5rem 0.75rem; border-radius: 6px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
}
.card.narrow { max-width: 380px; margin: 3rem auto; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.cards { list-style: none; padding: 0; margin: 0; }
.cards .card { margin-bottom: 0.75rem; }
.card-title { font-weight: 600; font-size: 1.05rem; text-decoration: none; color: var(--ink); }
.meta { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin-top: 0.4rem; font-size: 0.85rem; }
.tag { background: #eef2ff; color: #3730a3; padding: 0.1rem 0.5rem; border-radius: 999px; }
.status { padding: 0.1rem 0.55rem; border-radius: 999px; font-size: 0.8rem; text-transform: capitalize; }
.s-nuovo { background: #dbeafe; color: var(--new); }
.s-in_corso { background: #fef3c7; color: var(--warn); }
.s-fatto { background: #d1fae5; color: var(--ok); }
.desc { white-space: pre-wrap; }
.vision .lead { font-size: 1.2rem; font-weight: 500; color: var(--ink); margin: 0.5rem 0 1rem; }
.vision p { max-width: 60ch; }
.danger-link { color: #b91c1c; }
.comments { margin-top: 0.5rem; }
.comment { border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem 0.8rem; margin-bottom: 0.6rem; background: #fbfdff; }
.comment.from-admin { background: #eef5ff; border-color: #cfe0ff; }
.comment-head { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.85rem; margin-bottom: 0.2rem; }
.comment-body { margin: 0; white-space: pre-wrap; }
.comment-form textarea { width: 100%; }
.comment-form button { margin-top: 0.4rem; }
.badge { display: inline-block; min-width: 1.1rem; padding: 0 0.35rem; background: #dc2626; color: #fff; border-radius: 999px; font-size: 0.72rem; line-height: 1.1rem; text-align: center; }
.notif-list { list-style: none; padding: 0; margin: 0; }
.notif { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; padding: 0.6rem 0.8rem; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 0.5rem; background: var(--card); }
.notif.unread { border-left: 4px solid var(--accent); background: #f5f9ff; }
.notif-msg { text-decoration: none; color: var(--ink); }
.back { display: inline-block; margin-bottom: 0.5rem; text-decoration: none; color: var(--accent); }
label { display: block; margin: 0.6rem 0; font-weight: 500; }
input, textarea, select {
  width: 100%;
  padding: 0.55rem 0.65rem;
  margin-top: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  font: inherit;
  background: #fff;
}
button, .btn {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  padding: 0.55rem 1rem;
  border-radius: 7px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
button:hover, .btn:hover { filter: brightness(1.05); }
button.danger { background: #dc2626; padding: 0.3rem 0.7rem; font-size: 0.85rem; }
.linkbtn { background: none; border: none; color: var(--accent); cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }
.inline { display: inline; }
.inline-form { display: flex; gap: 0.5rem; align-items: center; }
.inline-form select { width: auto; }
.filters { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.filters select { width: auto; }
.files { padding-left: 1.1rem; }
table.queue { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
table.queue th, table.queue td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line); }
table.queue th { background: #f8fafc; font-size: 0.85rem; color: var(--muted); }
table.queue tr:last-child td { border-bottom: none; }
.row-s-fatto td { opacity: 0.6; }
table.queue a { color: var(--accent); text-decoration: none; }
@media (max-width: 600px) {
  table.queue thead { display: none; }
  table.queue, table.queue tbody, table.queue tr, table.queue td { display: block; width: 100%; }
  table.queue tr { border-bottom: 2px solid var(--line); padding: 0.4rem 0; }
  table.queue td { border: none; padding: 0.25rem 0.75rem; }
}
