* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #f4f5f7;
  color: #1e2430;
}
main { max-width: 1280px; margin: 0 auto; padding: 1rem 1.5rem 3rem; }
h1 { font-size: 1.4rem; }
h2 { font-size: 1.05rem; margin: 1.6rem 0 .5rem; }
a { color: #2456b0; text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: #7a8194; }
.error { color: #b02430; }

.topbar {
  display: flex; align-items: center; gap: 1.2rem;
  background: #1e2430; color: #fff; padding: .6rem 1.5rem;
}
.topbar .brand { font-weight: 600; margin-right: 1rem; }
.topbar a { color: #c6cbe0; }
.topbar a.active, .topbar a:hover { color: #fff; text-decoration: none; }
.topbar .spacer { flex: 1; }

.login-box {
  max-width: 320px; margin: 12vh auto; background: #fff; padding: 2rem;
  border-radius: 10px; box-shadow: 0 2px 12px rgba(0,0,0,.08); text-align: center;
}
.login-box input {
  width: 100%; padding: .55rem .7rem; margin: .8rem 0; font-size: 1rem;
  border: 1px solid #c7ccd8; border-radius: 6px;
}
.login-box button {
  width: 100%; padding: .55rem; font-size: 1rem; border: 0; border-radius: 6px;
  background: #2456b0; color: #fff; cursor: pointer;
}

.filters {
  display: flex; flex-wrap: wrap; gap: .8rem; align-items: end;
  background: #fff; padding: .8rem 1rem; border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06); font-size: .85rem;
}
.filters label { display: flex; flex-direction: column; gap: .2rem; color: #555c6e; }
.filters select, .filters input {
  padding: .3rem .4rem; border: 1px solid #c7ccd8; border-radius: 5px; font-size: .85rem;
}
.filters button {
  padding: .4rem .9rem; border: 0; border-radius: 5px; background: #2456b0;
  color: #fff; cursor: pointer;
}
.filters .reset { align-self: center; }

.cards { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1.2rem 0; }
.card {
  flex: 1; min-width: 130px; background: #fff; border-radius: 8px;
  padding: .9rem 1.1rem; box-shadow: 0 1px 4px rgba(0,0,0,.06);
  border-top: 3px solid #9aa3b8;
}
.card.ok { border-top-color: #2e9e5b; }
.card.bot { border-top-color: #d9a520; }
.card.bad { border-top-color: #cc3344; }
.card-num { font-size: 1.7rem; font-weight: 700; }
.card-label { color: #7a8194; font-size: .85rem; }

.chart {
  display: flex; align-items: flex-end; gap: 2px; height: 180px;
  background: #fff; padding: 1rem 1rem 2.2rem; border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06); overflow-x: auto;
}
.chart-col { flex: 1; min-width: 14px; position: relative; height: 100%; }
.chart-col .bar {
  display: flex; flex-direction: column-reverse; height: 100%;
  justify-content: flex-start;
}
.seg.ok { background: #2e9e5b; }
.seg.bot { background: #d9a520; }
.seg.bad { background: #cc3344; }
.chart-label {
  position: absolute; bottom: -1.9rem; left: 50%;
  transform: translateX(-50%) rotate(-40deg);
  font-size: .6rem; color: #7a8194; white-space: nowrap;
}
.legend { margin-top: .6rem; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 .3rem 0 .8rem; }
.dot.ok { background: #2e9e5b; }
.dot.bot { background: #d9a520; }
.dot.bad { background: #cc3344; }

.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 800px) { .columns { grid-template-columns: 1fr; } }

table { border-collapse: collapse; width: 100%; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
td, th { padding: .35rem .6rem; font-size: .82rem; text-align: left; border-bottom: 1px solid #eef0f4; }
th { background: #eef0f4; color: #555c6e; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.path { font-family: ui-monospace, Consolas, monospace; font-size: .78rem; word-break: break-all; }
td.nowrap { white-space: nowrap; }
.table-wrap { overflow-x: auto; margin-top: 1rem; }

.badge {
  padding: .1rem .5rem; border-radius: 10px; font-size: .72rem; color: #fff;
}
.badge.previsto { background: #2e9e5b; }
.badge.bot { background: #d9a520; }
.badge.sospetto { background: #cc3344; }

.row-sospetto { background: #fdf3f4; }
.row-bot { background: #fdfaf0; }

.status-2xx { color: #2e9e5b; }
.status-3xx { color: #7a8194; }
.status-4xx { color: #d9a520; }
.status-5xx { color: #cc3344; font-weight: 700; }

.pagination { display: flex; gap: 1rem; margin-top: 1rem; align-items: center; }
