:root {
  --bg: #e6e8ed;
  --panel: #f3f4f7;
  --card: #fafbfc;
  --input: #ffffff;
  --line: #cdd2db;
  --text: #2d323c;
  --muted: #667085;
  --acc: #2f6fed;
  --ok: #2f9e68;
  --warn: #b8860b;
  --bad: #c94a57;
  --ro: #5c6778;
  --menu: #dce0e7;
  --hover: #cfd5de;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 "Segoe UI", system-ui, sans-serif; }
a { color: var(--acc); }
.app { display: flex; align-items: flex-start; min-height: 100vh; }
.menu {
  width: 220px; flex: 0 0 220px; min-height: 100vh; padding: 20px 14px;
  background: var(--menu); border-right: 1px solid var(--line); position: sticky; top: 0;
}
.menu-title { font-weight: 700; margin-bottom: 12px; }
.menu-sub { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 16px 0 8px; }
.menu-link, .menu a {
  display: block; color: var(--text); text-decoration: none; padding: 6px 8px; border-radius: 8px; font-size: 14px;
}
.menu-link:hover, .menu a:hover { background: var(--hover); }
.menu a.active { background: #c5d4f0; color: #1a3f8a; }
.menu-row { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.wrap { flex: 1; max-width: 1100px; margin: 0 auto; padding: 28px 20px 60px; }
h1 { font-size: 22px; margin: 0 0 8px; }
h2 { font-size: 15px; margin: 0 0 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.muted { color: var(--muted); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin: 14px 0; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
input, select, button, textarea {
  font: inherit; color: var(--text); background: var(--input); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
}
textarea { width: 100%; resize: vertical; }
.task-main { white-space: pre-wrap; font-size: 15px; line-height: 1.5; }
button { background: var(--acc); border-color: transparent; color: #fff; cursor: pointer; font-weight: 600; }
button.ghost { background: var(--input); border-color: var(--line); color: var(--text); }
button.bad { background: var(--bad); color: #fff; }
button.ok { background: var(--ok); color: #fff; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.ro { background: #d9dee6; color: var(--ro); }
.badge.edit { background: #d4eedf; color: #1f7a4a; }
.badge.over { background: #f6d6da; color: #a13340; }
.badge.today { background: #f5e6c0; color: #8a6508; }
.badge.deferred { background: #e4e7ee; color: var(--muted); }
.badge.progress { background: #d5e4f8; color: #2158a8; }
.badge.done { background: #d4eedf; color: #1f7a4a; }
.badge.closed { background: #e6dff0; color: #6b4f91; }
.actions button.active { outline: 2px solid var(--acc); }
.top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.task {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px; margin: 0 0 10px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--card);
}
.task-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.task-id { font-weight: 700; font-size: 16px; letter-spacing: .01em; }
.task-log { font-size: 13px; color: var(--muted); background: #eef0f4; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.task-log summary { cursor: pointer; color: var(--text); font-weight: 600; }
.task-log ul { margin: 8px 0 0; padding: 0; list-style: none; }
.task-log li { padding: 8px 0; border-top: 1px solid var(--line); }
.log-meta { display: block; font-size: 12px; margin-bottom: 4px; }
.log-text { color: var(--text); margin-top: 4px; white-space: pre-wrap; }
.who { color: #2158a8; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 800px) {
  .grid2 { grid-template-columns: 1fr; }
}
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.actions button { padding: 6px 8px; font-size: 12px; }
.hidden { display: none !important; }
.err { color: var(--bad); min-height: 1.2em; }
.archive { font-size: 13px; color: var(--muted); max-height: 280px; overflow: auto; }
.archive div { padding: 4px 0; border-bottom: 1px solid var(--line); }
.gate { max-width: 420px; margin: 12vh auto; }
.remind { border-color: #e0c98a; background: #f7efd8; }
.modal {
  position: fixed; inset: 0; background: rgba(45, 50, 60, .35);
  z-index: 20; padding: 16px;
}
