:root {
  --pico-font-size: 95%;
}

main.container {
  max-width: 960px;
  padding-top: 1rem;
}

nav.topnav {
  border-bottom: 1px solid var(--pico-muted-border-color);
  margin-bottom: 1rem;
}

nav.topnav ul li a[aria-current="page"] {
  font-weight: bold;
  text-decoration: underline;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.card {
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 8px;
  padding: 0.8rem 1rem;
}

.card .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--pico-muted-color);
}

.card .value {
  font-size: 1.5rem;
  font-weight: bold;
}

.card .hint {
  font-size: 0.75rem;
  color: var(--pico-muted-color);
}

.value.ok { color: #2e7d32; }
.value.warn { color: #ef6c00; }
.value.over { color: #c62828; }

.progress-wrap {
  background: var(--pico-muted-border-color);
  border-radius: 999px;
  height: 14px;
  overflow: hidden;
  margin: 0.3rem 0 1.2rem;
}

.progress-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s;
}

.progress-bar.ok { background: #4caf50; }
.progress-bar.warn { background: #ff9800; }
.progress-bar.over { background: #f44336; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  margin: 0 0.2rem 0.2rem 0;
  white-space: nowrap;
}

.chip form { display: inline; margin: 0; }

.chip button {
  all: unset;
  cursor: pointer;
  color: var(--pico-muted-color);
  padding: 0 0.15rem;
}

.dot {
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  border-radius: 50%;
}

table td, table th { padding: 0.4rem 0.5rem; }

td.num, th.num { text-align: right; white-space: nowrap; }

.row-actions { white-space: nowrap; text-align: right; }

.row-actions button {
  all: unset;
  cursor: pointer;
  padding: 0 0.3rem;
}

.inline-form { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: end; }

.inline-form > label { margin: 0; flex: 1 1 120px; }

.inline-form button { flex: 0 0 auto; margin-bottom: 0; }

.muted { color: var(--pico-muted-color); font-size: 0.85rem; }

tr.dup, tr.error-row { opacity: 0.55; }

.badge {
  font-size: 0.7rem;
  border-radius: 4px;
  padding: 0.05rem 0.4rem;
  background: var(--pico-muted-border-color);
}

#chart-box { max-width: 420px; margin: 0 auto; }

.login-box { max-width: 380px; margin: 10vh auto; }
