/* Doggo Walk admin dashboard — hand-rolled, zero external deps (helmet CSP
   keeps everything same-origin). */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color: #1c2330;
  background: #f4f6f9;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: #101828;
  color: #fff;
}
header h1 { font-size: 18px; margin: 0; }
.session { font-size: 13px; }
main { max-width: 1100px; margin: 24px auto; padding: 0 16px; }
.hidden { display: none !important; }

#login-view { max-width: 420px; }
.field { display: block; margin-top: 12px; }
.field label { display: block; margin-bottom: 4px; font-weight: 600; }
input, select {
  padding: 8px 10px;
  border: 1px solid #c6ccd6;
  border-radius: 6px;
  font-size: 14px;
  width: 100%;
}
button {
  margin-top: 14px;
  padding: 8px 18px;
  border: 1px solid #1d4ed8;
  border-radius: 6px;
  background: #2563eb;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}
button:hover { background: #1d4ed8; }
button.linklike {
  margin: 0 0 0 10px;
  padding: 2px 10px;
  background: transparent;
  color: #9db2cc;
  border: 1px solid #33415c;
  font-size: 12px;
}
.hint { color: #5b6472; font-size: 13px; }
.msg { min-height: 18px; margin-top: 10px; font-size: 13px; }
.msg.error, .error { color: #b42318; }
.muted { color: #8a94a3; }

.cards { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.card {
  flex: 1 1 120px;
  background: #fff;
  border: 1px solid #e2e6ec;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.card-num { font-size: 28px; font-weight: 700; }
.card-label { font-size: 12px; color: #5b6472; }
.card.p0 { border-left: 4px solid #b42318; }
.card.p1 { border-left: 4px solid #dc6803; }
.card.p2 { border-left: 4px solid #fbdc45; }
.card.p3 { border-left: 4px solid #98a2b3; }
.card.top-codes { flex-basis: 100%; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-block;
  background: #f2f4f7;
  border: 1px solid #e2e6ec;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
}
.chip code { font-weight: 600; }

.filters {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid #e2e6ec;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
}
.filters label { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.filters select, .filters input { width: auto; padding: 5px 8px; font-size: 13px; }
.filters button { margin-top: 0; padding: 5px 14px; font-size: 13px; }
#pager { margin-left: auto; font-size: 13px; color: #5b6472; }

#errors-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #e2e6ec;
  border-radius: 10px;
  overflow: hidden;
}
#errors-table th, #errors-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #eef1f5;
  font-size: 13px;
}
#errors-table th { background: #f8fafc; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: #5b6472; }
#errors-table tr.row { cursor: pointer; }
#errors-table tr.row:hover { background: #f4f7fb; }
.msgcell { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12px; background: #f2f4f7; padding: 1px 5px; border-radius: 4px; }

.badge { display: inline-block; border-radius: 4px; padding: 2px 8px; font-size: 12px; font-weight: 700; color: #fff; }
.badge.p0 { background: #b42318; }
.badge.p1 { background: #dc6803; }
.badge.p2 { background: #fbdc45; color: #1c2330; }
.badge.p3 { background: #98a2b3; }

#detail {
  margin-top: 20px;
  background: #fff;
  border: 1px solid #e2e6ec;
  border-radius: 10px;
  padding: 16px;
}
#detail h3 { margin: 4px 0 12px; }
.kv { margin-bottom: 12px; }
.kv b { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: #5b6472; }
.kv pre {
  margin: 4px 0 0;
  background: #0f172a;
  color: #d7e1f0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  overflow-x: auto;
  max-height: 260px;
}
#btn-close-detail { float: right; margin-top: 0; padding: 4px 12px; font-size: 12px; background: #fff; color: #5b6472; border-color: #c6ccd6; }

/* Screen load times (§4.9) */
#loads-view {
  background: #fff;
  border: 1px solid #e2e6ec;
  border-radius: 10px;
  padding: 16px;
  margin-top: 20px;
}
#loads-view h2 { margin: 0 0 12px; font-size: 16px; }
#loads-view h2 .hint { font-weight: 400; font-size: 12px; margin-left: 8px; }
#loads-view h3 { margin: 16px 0 4px; font-size: 14px; }
#loads-chart svg { width: 100%; height: auto; }
#loads-chart .muted { padding: 24px 0; text-align: center; }
.legend { display: flex; gap: 16px; align-items: center; font-size: 12px; color: #5b6472; margin: 0 0 8px; }
.legend .swatch { display: inline-block; width: 20px; height: 0; border-top: 3px solid; margin-right: 5px; vertical-align: middle; }
.legend .sw-avg { border-color: #2563eb; }
.legend .sw-p95 { border-color: #b42318; border-top-style: dashed; }
.legend .sw-count { width: 8px; height: 10px; background: #98a2b3; border: none; }
.chart-avg { fill: none; stroke: #2563eb; stroke-width: 2; }
.chart-p95 { fill: none; stroke: #b42318; stroke-width: 2; stroke-dasharray: 5 4; }
.chart-dot-avg { fill: #2563eb; }
.chart-dot-p95 { fill: #b42318; }
.chart-axis { stroke: #d0d6e0; }
.chart-grid { stroke: #eef1f5; }
.chart-text { font-size: 10px; fill: #5b6472; }
.spark-bar { fill: #98a2b3; }
#loads-table { width: 100%; border-collapse: collapse; }
#loads-table th, #loads-table td {
  padding: 6px 12px;
  text-align: left;
  border-bottom: 1px solid #eef1f5;
  font-size: 13px;
}
#loads-table th { background: #f8fafc; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: #5b6472; }
