/* Pannello di controllo */
@font-face { font-family: "Cabinet Grotesk"; font-weight: 800; font-display: swap; src: url("fonts/cabinet-grotesk-800.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400 700; font-display: swap; src: url("fonts/ibm-plex-sans-latin.woff2") format("woff2"); }
:root { --ink: #0A0A0A; --red: #E53935; --yellow: #FBC02D; --line: #DDDDE2; --soft: #F4F4F5; --muted: #62626B; --ok: #15803D; }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--soft); color: var(--ink); font: 400 15px/1.5 "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--red); }
h1, h2, h3, p, ul, ol { margin: 0; }
h1 { font: 800 1.7rem/1.1 "Cabinet Grotesk", "Arial Black", Arial, sans-serif; letter-spacing: -.02em; margin-bottom: 18px; }
h2 { font: 800 1.15rem/1.2 "Cabinet Grotesk", "Arial Black", Arial, sans-serif; margin: 0 0 10px; }
h3 { font-size: .95rem; margin: 18px 0 4px; }
p + p, p + ul, ul + p, p + ol, p + pre, pre + p { margin-top: 10px; }
code { background: var(--soft); padding: 1px 5px; font: .85em ui-monospace, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted, .help { color: var(--muted); font-size: .85rem; }
.help { margin-top: 5px; }

.bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 5; }
.bar a { color: #fff; }
.brand { font: 800 1rem/1 "Cabinet Grotesk", Arial, sans-serif; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-r { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: .85rem; white-space: nowrap; }
.bar form { margin: 0; }
.linkb { background: none; border: 0; color: #fff; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 0; }
.pill { display: inline-block; font-size: .72rem; font-weight: 600; padding: 2px 8px; background: #3a3a40; color: #fff; border-radius: 10px; white-space: nowrap; }
.pill.ok { background: var(--ok); }
td .pill { margin-left: 4px; }

.shell { display: block; }
.side { display: flex; gap: 2px; overflow-x: auto; background: #fff; border-bottom: 1px solid var(--line); padding: 0 10px; }
.side a { flex: none; padding: 11px 10px; font-size: .85rem; text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; }
.side a.on { border-bottom-color: var(--red); font-weight: 700; }
.main { padding: 20px 16px 60px; max-width: 980px; }
@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 44px); }
  .side { flex-direction: column; overflow: visible; border-bottom: 0; border-right: 1px solid var(--line); padding: 14px 0; gap: 0; }
  .side a { border-bottom: 0; border-left: 3px solid transparent; padding: 9px 18px; font-size: .9rem; }
  .side a.on { border-left-color: var(--red); background: var(--soft); }
  .main { padding: 28px 32px 80px; }
}

.panel { background: #fff; border: 1px solid var(--line); padding: 18px; margin-bottom: 16px; }
details.panel > summary { cursor: pointer; }
details.panel[open] > summary { margin-bottom: 14px; }
.msg { padding: 10px 12px; margin-bottom: 12px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--ok); overflow-wrap: anywhere; }
.msg.err { border-left-color: var(--red); }
.msg.warn { border-left-color: var(--yellow); }
.panel .msg { background: var(--soft); }

.f { margin-bottom: 14px; min-width: 0; border: 0; padding: 0; }
.f > label, .f > legend { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 4px; padding: 0; }
.f input[type=text], .f input[type=url], .f input[type=email], .f input[type=password], .f input[type=number], .f input[type=date], .f input[type=search], .f select, .f textarea,
.filters input, .filters select, .bulk select { width: 100%; padding: 9px 10px; border: 1px solid #b9b9c2; background: #fff; font: inherit; color: inherit; border-radius: 0; }
.f textarea { resize: vertical; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; line-height: 1.5; }
.fc label { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; }
.fc input { margin-top: 4px; flex: none; }
.row2 { display: grid; gap: 0 16px; }
@media (min-width: 640px) { .row2 { grid-template-columns: 1fr 1fr; } }
.months { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; }
.months label { font-weight: 400; display: inline-flex; gap: 5px; align-items: center; }

.b { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 7px 14px; border: 1px solid var(--ink); background: #fff; color: var(--ink); font: 600 .88rem/1.2 inherit; font-family: inherit; text-decoration: none; cursor: pointer; }
.b:hover { background: var(--ink); color: #fff; }
.b-main { background: var(--ink); color: #fff; }
.b-main:hover { background: var(--red); border-color: var(--red); }
.b-danger { border-color: var(--red); color: var(--red); }
.b-danger:hover { background: var(--red); color: #fff; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

.filters { display: grid; gap: 8px; margin-bottom: 14px; }
@media (min-width: 760px) { .filters { grid-template-columns: 2fr 1.2fr 1fr 1fr auto auto; align-items: center; } }
.count { margin-bottom: 8px; color: var(--muted); font-size: .85rem; }
.tw { overflow-x: auto; background: #fff; border: 1px solid var(--line); margin-bottom: 12px; }
.panel .tw { border: 0; }
.t { width: 100%; border-collapse: collapse; font-size: .86rem; }
.t th, .t td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.t th { font-size: .78rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
.t tr:last-child td { border-bottom: 0; }
.t .n { text-align: right; font-variant-numeric: tabular-nums; }
.t .when { white-space: nowrap; color: var(--muted); }
.bulk { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.bulk select { width: auto; }
.pager { display: flex; flex-wrap: wrap; gap: 6px; }
.pager a, .pager b { padding: 5px 10px; border: 1px solid var(--line); background: #fff; text-decoration: none; }
.pager b { background: var(--ink); color: #fff; border-color: var(--ink); }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.stats div { background: #fff; border: 1px solid var(--line); padding: 14px; }
.stats b { display: block; font: 800 1.7rem/1 "Cabinet Grotesk", Arial, sans-serif; }
.stats span { color: var(--muted); font-size: .82rem; }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.ticks, .facts, .steps { padding-left: 20px; }
.ticks li, .facts li, .steps li { margin-top: 5px; }
.code { background: var(--ink); color: #f1f1f3; padding: 12px; overflow-x: auto; font: .82rem/1.5 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0; }
.msg .code { margin-top: 8px; }

body.solo { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.box { width: 100%; max-width: 440px; background: #fff; border: 1px solid var(--line); padding: 26px; }
.box h1 { margin-bottom: 6px; }
.box form { margin-top: 18px; }
