:root {
  --bg: #f6f7f9; --card: #ffffff; --text: #1d2330; --muted: #6b7280; --line: #e3e6ec;
  --accent: #2f6fed; --accent-text: #ffffff; --ok: #1f9d55; --warn: #c27c0e; --bad: #d64545;
  --bubble: #eef4ff; --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171c; --card: #1d2128; --text: #e6e8ec; --muted: #9aa3ae; --line: #2c323b;
    --accent: #5b8ff9; --accent-text: #0b1020; --ok: #3ccf7f; --warn: #e2a33a; --bad: #ff6b6b;
    --bubble: #20304d;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
header { background: var(--card); border-bottom: 1px solid var(--line); }
.bar { max-width: 1100px; margin: 0 auto; padding: 10px 16px; display: flex; gap: 16px;
  align-items: center; flex-wrap: wrap; }
.bar .brand { font-weight: 600; }
.bar nav { display: flex; gap: 14px; flex-wrap: wrap; flex: 1; }
.bar nav a.on { font-weight: 600; color: var(--text); }
.bar .me { color: var(--muted); font-size: 13px; }
main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 17px; margin: 24px 0 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stat .num { font-size: 26px; font-weight: 600; }
.stat .lbl { color: var(--muted); font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); }
.msg { background: var(--bubble); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; }
.err { background: color-mix(in srgb, var(--bad) 14%, transparent); border-radius: var(--radius);
  padding: 10px 14px; margin-bottom: 16px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; white-space: nowrap; }
.progress { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; min-width: 80px; }
.progress span { display: block; height: 100%; background: var(--ok); }
label { display: block; font-weight: 500; margin: 12px 0 4px; }
label .hint { font-weight: 400; color: var(--muted); font-size: 13px; }
input[type=text], input[type=date], input[type=time], input[type=search], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--text); font: inherit; }
textarea { min-height: 90px; resize: vertical; }
textarea.big { min-height: 260px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }
button, .btn { display: inline-block; padding: 8px 16px; border-radius: 8px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-text); font: inherit; font-weight: 500; cursor: pointer; }
button.ghost, .btn.ghost { background: transparent; color: var(--accent); }
button.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; align-items: center; }
form.inline { display: inline; }
.bubble { background: var(--bubble); border-radius: 12px; padding: 12px 14px; white-space: pre-wrap;
  word-break: break-word; max-width: 520px; }
.kb { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; max-width: 520px; }
.kb span { border: 1px solid var(--line); border-radius: 8px; padding: 6px; text-align: center;
  font-size: 13px; background: var(--card); }
.preview-item { margin-bottom: 16px; }
.preview-item .when { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.cols { display: grid; gap: 16px; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } }
.pill { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px;
  border: 1px solid var(--line); color: var(--muted); }
.login { max-width: 420px; margin: 60px auto; text-align: center; }
