* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  color: #1f2328;
  background: #f6f7f9;
}
main { padding: 24px; max-width: 1200px; margin: 0 auto; }
h1 { font-size: 22px; margin: 0 0 16px; }

.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 10px 24px; background: #fff; border-bottom: 1px solid #e3e6ea;
}
.brand { font-weight: 600; color: #1f2328; text-decoration: none; }
.topbar nav { flex: 1; display: flex; gap: 16px; }
.topbar nav a { color: #3b5bdb; text-decoration: none; }
.who { color: #59636e; font-size: 14px; }

form.inline { display: inline; margin-left: 8px; }
button.link { background: none; border: 0; color: #3b5bdb; cursor: pointer; padding: 0; font: inherit; }

.login-box {
  max-width: 340px; margin: 12vh auto 0; padding: 28px;
  background: #fff; border: 1px solid #e3e6ea; border-radius: 10px;
}
.login-box h1 { text-align: center; }
label { display: block; margin-bottom: 14px; font-size: 14px; color: #59636e; }
input {
  display: block; width: 100%; margin-top: 4px; padding: 8px 10px;
  font: inherit; border: 1px solid #ccd1d7; border-radius: 6px;
}
button[type=submit]:not(.link):not(.secondary) {
  width: 100%; padding: 9px; font: inherit; font-weight: 600;
  color: #fff; background: #3b5bdb; border: 0; border-radius: 6px; cursor: pointer;
}
.error { color: #c92a2a; background: #fff5f5; padding: 8px 10px; border-radius: 6px; }

h2 { font-size: 17px; margin: 0 0 10px; }
a { color: #3b5bdb; }
.muted { color: #59636e; }
.small { font-size: 13px; margin-top: 4px; }
.error p { margin: 0 0 4px; }
.error p:last-child { margin: 0; }
.error { margin-bottom: 16px; }

.card {
  margin-top: 24px; padding: 20px; max-width: 560px;
  background: #fff; border: 1px solid #e3e6ea; border-radius: 10px;
}
.stack button[type=submit] { width: auto; padding: 8px 18px; }

table.grid { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e3e6ea; }
table.grid th, table.grid td { padding: 10px 12px; border-bottom: 1px solid #eef0f2; text-align: left; vertical-align: top; }
table.grid th { font-size: 13px; color: #59636e; font-weight: 600; background: #fafbfc; }
td.actions { width: 230px; }
td.actions details { margin-top: 8px; font-size: 14px; }
td.actions summary { cursor: pointer; color: #3b5bdb; }
td.actions details form { margin-top: 8px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 13px; background: #eef0f2; }
.badge.ok { background: #e6fcf5; color: #087f5b; }
.badge.err { background: #fff5f5; color: #c92a2a; }

button.secondary {
  padding: 6px 12px; font: inherit; font-size: 14px; cursor: pointer;
  color: #3b5bdb; background: #fff; border: 1px solid #3b5bdb; border-radius: 6px;
}
button[disabled] { opacity: .6; cursor: wait; }
.when-busy { display: none; }
.htmx-request .when-idle { display: none; }
.htmx-request .when-busy { display: inline; }

h3 { font-size: 15px; margin: 0 0 8px; }
.card.wide { max-width: none; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 14px; }
.filters label { margin: 0; }
.filters input, .filters select { width: auto; min-width: 160px; }
label.checkbox { display: flex; gap: 6px; align-items: center; padding-bottom: 8px; }
label.checkbox input { width: auto; min-width: 0; margin: 0; }
select { padding: 8px 10px; font: inherit; border: 1px solid #ccd1d7; border-radius: 6px; background: #fff; display: block; margin-top: 4px; }
.actions-row form.inline { margin: 0 8px 0 0; }
table.grid.compact th, table.grid.compact td { padding: 6px 10px; }
.check { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.check details { margin-top: 10px; font-size: 14px; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
tr.row-err td { background: #fffafa; }
table.log { font-size: 14px; }
.queue { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (max-width: 720px) {
  main { padding: 16px; }
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  table.log { display: block; overflow-x: auto; }
}
