:root {
  --bg: #f4f6f9; --card: #fff; --ink: #1c2530; --muted: #6b7684;
  --line: #e3e8ef; --brand: #1f6feb; --brand-d: #1a5fd0;
  --ok: #1a7f4b; --warn: #9a6a00; --err: #b42318;
  --ok-bg: #e7f6ee; --warn-bg: #fdf4e0; --err-bg: #fdeceb;
  --radius: 10px; --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }

.topbar { display: flex; align-items: center; gap: 24px; padding: 12px 24px;
  background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; font-size: 18px; text-decoration: none; color: var(--ink); }
.brand span { color: var(--brand); }
.topbar nav { display: flex; gap: 18px; }
.topbar nav a { text-decoration: none; color: var(--muted); font-weight: 500; }
.topbar nav a:hover { color: var(--ink); }
.topbar .who { margin-left: auto; display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 14px; }
.role { text-transform: uppercase; font-size: 11px; letter-spacing: .04em; background: #eef2f7; color: #475569; padding: 2px 6px; border-radius: 5px; }

.wrap { max-width: 1000px; margin: 28px auto; padding: 0 24px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 16px; }
h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 12px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 20px; }
.card.narrow { max-width: 440px; margin-left: auto; margin-right: auto; }
.card.center { text-align: center; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }

label { display: block; margin: 12px 0; font-weight: 500; }
label .muted { font-weight: 400; }
input[type=text], input[type=email], input[type=password], input:not([type]), select {
  display: block; width: 100%; margin-top: 5px; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 8px; font-size: 14px; background: #fff; }
input[type=file] { margin-top: 6px; font-size: 14px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
label.check input { width: auto; margin: 0; }
fieldset.box { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin: 14px 0; }

button, .btn { display: inline-block; cursor: pointer; border: 1px solid var(--line);
  background: #fff; color: var(--ink); padding: 8px 14px; border-radius: 8px; font-size: 14px;
  font-weight: 600; text-decoration: none; }
button:hover, .btn:hover { border-color: #cdd5df; }
.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.primary:hover { background: var(--brand-d); border-color: var(--brand-d); }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.link { border: none; background: none; color: var(--brand); padding: 0; font-weight: 500; cursor: pointer; }
form.inline { display: inline; }
.inline-upload { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-upload input:not([type=file]) { width: auto; margin: 0; }

table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: .03em; padding: 8px 10px; border-bottom: 2px solid var(--line); }
table.grid td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.grid tr:last-child td { border-bottom: none; }
.mono { font-family: var(--mono); }
.small { font-size: 12px; }
.muted { color: var(--muted); }
.trunc { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px;
  background: #eef2f7; color: #475569; }
.tag.req { background: var(--warn-bg); color: var(--warn); }
.tag.action { background: #eaf1fd; color: var(--brand-d); font-family: var(--mono); font-weight: 500; }

.alert { padding: 10px 13px; border-radius: 8px; margin: 12px 0; font-size: 14px; }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.warn { background: var(--warn-bg); color: var(--warn); }
.alert.error { background: var(--err-bg); color: var(--err); }

.sign-panel { border-left: 3px solid var(--brand); }
.sign-form .small { margin: 6px 0; }
.code { font-size: 46px; color: var(--brand); }
.foot { max-width: 1000px; margin: 10px auto 40px; padding: 0 24px; color: var(--muted); font-size: 12px; }
.btn.ghost, .config-form button, .sign-form button { margin-top: 8px; }
