:root {
  --bg: #f6f7f9; --panel: #fff; --ink: #1c2530; --muted: #6b7684; --line: #e2e6eb;
  --accent: #1f6feb; --accent-ink: #fff; --danger: #c62828; --ok: #1b7f3b; --warn: #b26a00;
  --radius: 8px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14181d; --panel: #1c2229; --ink: #e6eaef; --muted: #93a0ae; --line: #2c343d; --accent: #4c8dff; }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); display: grid; grid-template-columns: 208px 1fr; }
body.center { display: grid; grid-template-columns: 1fr; place-items: center; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 12px; } h2 { font-size: 17px; margin: 20px 0 8px; } h3 { font-size: 15px; margin: 14px 0 6px; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow: auto; }
.side a { color: var(--ink); padding: 7px 10px; border-radius: 6px; display: flex; justify-content: space-between; align-items: center; }
.side a:hover { background: var(--bg); text-decoration: none; }
.side a.on { background: var(--accent); color: var(--accent-ink); }
.side .brand { font-weight: 700; font-size: 17px; margin-bottom: 8px; }
.side .brand img { display: block; max-width: 100%; max-height: 40px; }
.side a.brand:hover { background: none; }
.brand-logo { display: block; max-width: 100%; max-height: 48px; margin-bottom: 6px; align-self: flex-start; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--line); padding-top: 8px; }
main { padding: 20px 28px; min-width: 0; max-width: 1280px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.page-head h1 { margin: 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.card.narrow { width: min(380px, 92vw); display: flex; flex-direction: column; gap: 10px; }
.muted { color: var(--muted); } .error { color: var(--danger); } .ok { color: var(--ok); } .warn { color: var(--warn); }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
button, .button { font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 6px; padding: 7px 12px; display: inline-block; }
button:hover, .button:hover { border-color: var(--accent); text-decoration: none; }
button.primary, .button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.danger { color: var(--danger); }
button.link { border: 0; background: none; padding: 7px 10px; color: var(--muted); text-align: left; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 8px; }
.list > li.unread { border-left: 3px solid var(--accent); }
table { border-collapse: collapse; width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
.badge { background: var(--danger); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 12px; }
.tag { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 1px 8px; font-size: 12px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.tabs a { padding: 7px 12px; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a.on { color: var(--ink); border-color: var(--accent); }
.board { display: flex; gap: 12px; align-items: flex-start; overflow-x: auto; }
.board > .col { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; min-width: 240px; width: 260px; }
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: var(--radius); max-width: 320px; }
@media (max-width: 760px) {
  body { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; }
  .side-foot { margin: 0; border: 0; padding: 0; flex-direction: row; }
  main { padding: 14px; }
}
