/* Stessa lingua visiva della console petrolheads: stessi colori, stessa
   struttura, stesso carattere. Chi passa dall'una all'altra non deve
   reimparare dove guardare. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { background: #f3f1ec; color: #1c1a17; font-family: 'Inter', system-ui, -apple-system, sans-serif; min-height: 100vh; }
a { color: inherit; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 28px; background: #1c1a17; color: #f3f1ec; gap: 16px; }
.topbar .brand { font-weight: 700; letter-spacing: .02em; text-decoration: none; flex-shrink: 0; }
.topbar nav { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.topbar nav a { text-decoration: none; color: #cfc9bd; white-space: nowrap; }
.topbar nav a:hover { color: #fff; }
.topbar .chi { color: #7a7368; }
.topbar form { display: inline; }
.topbar button.link { background: none; border: none; color: #cfc9bd; font: inherit; cursor: pointer; padding: 0; }
.topbar button.link:hover { color: #fff; }

main { max-width: 1100px; margin: 0 auto; padding: 28px 20px 60px; }
h1 { font-size: 24px; margin: 26px 0 14px; }
h1:first-child { margin-top: 0; }
h2 { font-size: 16px; margin: 24px 0 10px; }
.sotto { color: #7a7368; font-size: 14px; margin-bottom: 14px; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.flash.ok { background: #e5f2e6; color: #2b6b31; }
.flash.error { background: #f6e4e2; color: #9a2f24; }

/* Le fasce di stato. Il rosso e' riservato a «questo dato non vale»: se lo si
   usasse anche per «va tutto bene ma con riserva», smetterebbe di significare
   qualcosa nel momento in cui serve. */
.banner { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-size: 14px; }
.banner.verde  { background: #e5f2e6; color: #2b6b31; }
.banner.rosso  { background: #f6e4e2; color: #9a2f24; }
.banner.giallo { background: #f7efdc; color: #7a5a12; }
.banner.neutro { background: #fff; color: #4a453d; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.banner .nota { margin-top: 6px; color: #7a7368; font-size: 13px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 10px; padding: 16px 18px; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.stat-card .n { font-size: 24px; font-weight: 700; }
.stat-card .l { font-size: 12px; color: #7a7368; text-transform: uppercase; letter-spacing: .05em; }
.stat-card.male .n { color: #9a2f24; }

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.05); margin-bottom: 20px; font-size: 14px; }
th, td { text-align: left; padding: 9px 14px; border-bottom: 1px solid #eeebe4; }
th { background: #faf8f4; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #7a7368; }
tr:last-child td { border-bottom: none; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.quando { color: #7a7368; font-size: 12.5px; white-space: nowrap; }
td.motivo { color: #4a453d; font-size: 13px; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.tag.ok   { background: #e5f2e6; color: #2b6b31; }
.tag.ko   { background: #f6e4e2; color: #9a2f24; }
.tag.warn { background: #f7efdc; color: #7a5a12; }

.btn { background: #1c1a17; color: #f3f1ec; border: none; border-radius: 8px; padding: 10px 18px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { background: #34302a; }
.btn.rosso { background: #9a2f24; }
.btn.rosso:hover { background: #b23a2d; }
.comandi { display: flex; gap: 12px; flex-wrap: wrap; }

.login { max-width: 360px; margin: 60px auto; background: #fff; border-radius: 12px; padding: 28px; box-shadow: 0 2px 20px rgba(0,0,0,.06); }
.login label { display: block; font-size: 13px; color: #7a7368; margin-bottom: 14px; }
.login input { display: block; width: 100%; margin-top: 5px; padding: 10px 12px; border: 1px solid #ddd8cd; border-radius: 8px; font: inherit; }
.login .btn { width: 100%; }

.grezzi { background: #1c1a17; color: #e6e2d8; padding: 18px; border-radius: 10px; overflow-x: auto; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 1.5; }

@media (max-width: 700px) {
  .topbar { padding: 12px 16px; }
  .topbar nav { overflow-x: auto; gap: 14px; scrollbar-width: none; }
  .topbar nav::-webkit-scrollbar { display: none; }
  main { padding: 20px 14px 40px; }
  table { display: block; overflow-x: auto; }
}
