:root {
  --brand: #efbf00;
  --text: #3e4958;
  --muted: #7d8794;
  --line: #e3e6ea;
  --bg: #f6f7f9;
  --good: #1f8a4c;
  --warn: #b26a00;
  --bad: #c0362c;
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
body.narrow { max-width: 420px; margin: 10vh auto; padding: 0 16px; }
main { padding: 16px 24px 48px; max-width: 1280px; }
h1 { font-size: 24px; margin: 8px 0 12px; }
h2 { font-size: 17px; margin: 24px 0 8px; }
a { color: #1d5fbf; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.error { color: var(--bad); font-weight: 600; }

header.top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
  background: #222831; color: #fff; padding: 10px 24px;
}
header.top a { color: #fff; text-decoration: none; }
header.top nav { display: flex; gap: 16px; flex-wrap: wrap; }
header.top nav a:hover { text-decoration: underline; }
.brand { font-weight: 700; color: var(--brand) !important; }
.logout { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.who { color: #cfd5dc; }
.env { font-size: 12px; font-weight: 700; text-transform: uppercase; padding: 2px 8px; border-radius: 4px; }
.env-prod { background: var(--bad); color: #fff; }
.env-test { background: var(--brand); color: #222; }

table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: #fafbfc; }
table.compact { width: auto; min-width: 280px; }
td.num { text-align: right; white-space: nowrap; }
tr.total td { font-weight: 700; }

.badge { display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: 10px; background: #e9ecef; }
.badge.good { background: #dff3e7; color: var(--good); }
.badge.warn { background: #fff1d6; color: var(--warn); }
.badge.bad { background: #fbe1df; color: var(--bad); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.card .n { font-size: 28px; font-weight: 700; }

.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 24px; }
section.boxed { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 4px 16px 16px; margin-bottom: 16px; }
.titlebar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
dl { display: grid; grid-template-columns: 140px 1fr; gap: 4px 12px; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; }

form.stack { display: grid; gap: 10px; max-width: 460px; }
form.stack label, fieldset label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
fieldset { border: 1px solid var(--line); border-radius: 8px; display: grid; gap: 10px; }
form.inline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
input, textarea, button { font: inherit; }
input, textarea { padding: 7px 9px; border: 1px solid #c9ced6; border-radius: 6px; color: var(--text); background: #fff; }
button, a.button {
  display: inline-block; padding: 7px 14px; border-radius: 6px; border: 1px solid #c9a200;
  background: var(--brand); color: #222; font-weight: 600; cursor: pointer; text-decoration: none;
}
button.danger { background: #fff; color: var(--bad); border-color: var(--bad); }
header.top button { padding: 4px 10px; background: transparent; color: #fff; border-color: #6b7380; }

nav.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
nav.filters a { padding: 4px 10px; border-radius: 14px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--text); }
nav.filters a.current { background: var(--brand); border-color: #c9a200; }

.secret { background: #fffbe8; border: 2px dashed var(--brand); border-radius: 8px; padding: 8px 16px; max-width: 520px; }
.secret .code { font: 700 30px/1.2 ui-monospace, Menlo, monospace; letter-spacing: .12em; margin: 4px 0; user-select: all; }

img.thumb { max-width: 90px; max-height: 60px; border-radius: 4px; border: 1px solid var(--line); }
.chat { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; max-width: 720px; }
.msg { margin: 6px 0; }
.msg.driver { padding-left: 24px; }
