:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #1d2330;
  --muted: #667085;
  --border: #d9dde5;
  --accent: #1f5fbf;
  --accent-hover: #184c99;
  --ok-bg: #e8f5ec;
  --ok-text: #1c6b36;
  --warn-bg: #fff6e0;
  --warn-text: #7a5300;
  --err-bg: #fdecec;
  --err-text: #9b1c1c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

a { color: var(--accent); }

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.brand { font-weight: 700; color: var(--text); text-decoration: none; }
.nav { display: flex; gap: 16px; flex: 1; flex-wrap: wrap; }
.nav a { text-decoration: none; }
.who { display: flex; align-items: center; gap: 12px; }
.who-name { color: var(--muted); }

.page { max-width: 1100px; margin: 0 auto; padding: 24px 16px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.head-actions { display: flex; align-items: center; gap: 16px; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 24px; flex-wrap: wrap; margin-top: 20px; }
.summary { font-size: 16px; }

h1 { font-size: 24px; margin: 0 0 16px; }
h2 { font-size: 18px; margin: 0 0 12px; }

.card + .card { margin-top: 16px; }
.card-form { max-width: 520px; }
.card-wide { max-width: 720px; }
.num { text-align: right; white-space: nowrap; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
.text-error { color: var(--err-text); font-weight: 600; }
.notice-info { background: #eaf1fc; color: #1d3f73; }
.token { display: block; font-size: 15px; background: #eef1f6; padding: 10px 12px; border-radius: 6px; word-break: break-all; user-select: all; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.tile { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--text); }
.tile:hover { border-color: var(--accent); }
.tile + .tile { margin-top: 0; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 24px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
ul.plain { margin: 0; padding-left: 18px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
}
.card-narrow { max-width: 460px; margin: 32px auto; }
.empty { text-align: center; padding: 40px 24px; }
.muted { color: var(--muted); }

.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.form label small { font-weight: 400; }
.form label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
input, select {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.actions { display: flex; align-items: center; gap: 16px; }

.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  padding: 8px 16px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--accent-hover); }
.btn-secondary { background: #eef1f6; color: var(--text); }
.btn-secondary:hover { background: #e1e6ee; }
.btn-link { font: inherit; background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; text-decoration: underline; }
form.inline { display: inline; margin: 0; }

.notice { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; }
.notice-success { background: var(--ok-bg); color: var(--ok-text); }
.notice-warning { background: var(--warn-bg); color: var(--warn-text); }
.notice-error { background: var(--err-bg); color: var(--err-text); }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: 13px; color: var(--muted); font-weight: 600; }
.row-off td { color: var(--muted); }

.credentials { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 16px 0; }
.credentials dt { color: var(--muted); }
.credentials dd { margin: 0; }
.credentials code { font-size: 18px; background: #eef1f6; padding: 2px 8px; border-radius: 4px; user-select: all; }

.details { white-space: pre-wrap; font-size: 12px; background: #f3f4f6; padding: 12px; overflow: auto; }

hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }

@media (max-width: 640px) {
  .page-head { flex-direction: column; align-items: flex-start; }
  .table thead { display: none; }
  .table tr { display: block; border-bottom: 1px solid var(--border); padding: 8px 0; }
  .table td { display: block; border: 0; padding: 2px 0; }
}
