:root {
  --bg: #f6f7f9; --card: #fff; --text: #1f2937; --muted: #6b7280; --line: #e5e7eb;
  --accent: #4f46e5; --accent-fg: #fff; --err: #dc2626;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1115; --card: #181b21; --text: #e5e7eb; --muted: #9ca3af; --line: #2a2f38; --accent: #818cf8; --accent-fg: #0f1115; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; }
h1 { font-size: 1.5rem; margin: .25rem 0 1rem; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.wrap.narrow { max-width: 420px; padding-top: 4rem; }

.topbar { display: flex; justify-content: space-between; align-items: center; padding: .75rem 1.25rem; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; display: flex; align-items: center; gap: .5rem; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.topbar nav { display: flex; align-items: center; gap: 1rem; }
.topbar form { margin: 0; }
button.link { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.25rem; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.filters input[type=search] { flex: 1 1 240px; }
input, select { font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .65rem; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.btn { font: inherit; cursor: pointer; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-fg); border-radius: 8px; padding: .5rem .9rem; display: inline-block; }
.btn.ghost { background: transparent; color: var(--accent); }

.table-wrap { padding: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .7rem 1rem; border-bottom: 1px solid var(--line); }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.title { font-weight: 600; }
.count { font-size: 1rem; font-weight: 400; }

.badge { display: inline-block; padding: .1rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--line); color: var(--text); }
.stato-da_triare { background: #fef3c7; color: #92400e; }
.stato-aperto { background: #dbeafe; color: #1e40af; }
.stato-in_lavorazione { background: #ede9fe; color: #5b21b6; }
.stato-chiuso { background: #dcfce7; color: #166534; }
.prio-bassa { background: #f3f4f6; color: #4b5563; }
.prio-media { background: #dbeafe; color: #1e40af; }
.prio-alta { background: #ffedd5; color: #c2410c; }
.prio-critica { background: #fee2e2; color: #b91c1c; }

.pager { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 1rem; }
.empty { text-align: center; color: var(--muted); padding: 3rem; }

.detail-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.descr { margin: 1rem 0; }
.meta { display: flex; gap: 2rem; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 1rem; margin: 0; }
.meta dt { font-size: .75rem; text-transform: uppercase; color: var(--muted); }
.meta dd { margin: 0; }
.edit { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 1rem; }
.edit label, .login label { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; color: var(--muted); }

.login h1 { margin-top: 0; }
.login form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }
.login input { width: 100%; }
.error { color: var(--err); }

.page-head { display: flex; justify-content: space-between; align-items: center; }
.bugform { display: flex; flex-direction: column; gap: 1rem; }
.bugform label { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; color: var(--muted); }
.bugform input, .bugform select, .bugform textarea { width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .65rem; }
.bugform .errorlist { color: var(--err); list-style: none; margin: 0; padding: 0; }
.wrap.narrow-lg { max-width: 640px; }
