:root {
  --bg: #f6f8fa; --card: #fff; --border: #d0d7de; --text: #1f2328;
  --muted: #57606a; --accent: #0969da; --accent-d: #0a5cc2;
  --green: #1a7f37; --amber: #9a6700; --red: #cf222e; --chip: #eaeef2;
}
* { box-sizing: border-box; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  margin: 0; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
header.topbar {
  display: flex; align-items: center; gap: 18px; padding: 10px 20px;
  background: #24292f; color: #fff; flex-wrap: wrap;
}
header.topbar a { color: #d0d7de; font-weight: 500; }
header.topbar a:hover, header.topbar a.active { color: #fff; }
header.topbar .brand { font-weight: 700; color: #fff; font-size: 16px; }
header.topbar .spacer { flex: 1; }
.badge { background: var(--red); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 12px; }
main { max-width: 1180px; margin: 20px auto; padding: 0 20px; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin: 14px 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; color: var(--muted); }
tr:hover td { background: #f9fafb; }
.chip { display: inline-block; background: var(--chip); border-radius: 12px; padding: 1px 9px; font-size: 12px; margin: 1px; }
.chip.status { color: #fff; }
.status-new { background: #6e7781; } .status-under_review { background: #0969da; }
.status-qualified { background: #1a7f37; } .status-rejected { background: #cf222e; }
.status-in_preparation { background: #9a6700; } .status-ready_for_submission { background: #8250df; }
.status-submitted { background: #1f6feb; } .status-archived { background: #424a53; }
.prio-high { color: var(--red); font-weight: 700; } .prio-medium { color: var(--amber); }
.prio-low { color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: 12px; }
button, .btn {
  font: inherit; background: var(--accent); color: #fff; border: 0; border-radius: 6px;
  padding: 6px 12px; cursor: pointer;
}
button:hover, .btn:hover { background: var(--accent-d); text-decoration: none; }
button.secondary, .btn.secondary { background: #eaeef2; color: var(--text); }
button.danger { background: var(--red); }
button.small, .btn.small { padding: 3px 8px; font-size: 12px; }
input, select, textarea {
  font: inherit; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px;
  background: #fff; max-width: 100%;
}
textarea { width: 100%; min-height: 90px; font-family: inherit; }
label { font-size: 13px; color: var(--muted); display: block; margin-top: 8px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: 2fr 1fr; }
@media (max-width: 800px) { .grid.two { grid-template-columns: 1fr; } }
.alert { padding: 10px 12px; border-radius: 6px; margin: 10px 0; }
.alert.error { background: #ffebe9; color: var(--red); border: 1px solid #ffcecb; }
.alert.info { background: #ddf4ff; color: var(--accent); border: 1px solid #b6e3ff; }
.alert.empty { background: #f6f8fa; color: var(--muted); border: 1px dashed var(--border); text-align: center; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 12px; }
.login-box { max-width: 360px; margin: 80px auto; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid #c9d1d9;
  border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.note-item, .comment-item { border-bottom: 1px solid var(--border); padding: 8px 0; }
.done td, .done { opacity: 0.55; text-decoration: line-through; }
pre.preview { background: #f6f8fa; padding: 10px; border-radius: 6px; overflow-x: auto; white-space: pre-wrap; }
