:root {
  --bg: #f4f5f7; --panel: #ebecf0; --card: #fff; --text: #172b4d; --muted: #6b778c;
  --blue: #0052cc; --blue-d: #0747a6; --red: #de350b; --border: #dfe1e6;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.4 -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; border-radius: 3px; padding: 6px 12px; background: var(--panel); }
button:hover { background: #dfe1e6; }
button.primary { background: var(--blue); color: #fff; }
button.primary:hover { background: var(--blue-d); }
button.danger { background: var(--red); color: #fff; }
button.danger-ghost { color: var(--red); background: transparent; }
button.link { background: none; color: var(--blue); padding: 6px 4px; }
.spacer { flex: 1; }

.topbar { display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; color: var(--blue); font-size: 16px; margin-right: 16px; }
.tab { background: none; border-radius: 0; border-bottom: 3px solid transparent; padding: 8px 12px; }
.tab.active { color: var(--blue); border-bottom-color: var(--blue); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; align-items: center; }
.filters input, .filters select { padding: 6px 8px; border: 2px solid var(--border); border-radius: 3px; background: #fff; }
.filters input { min-width: 240px; }

main { padding: 0 16px 32px; }
.board { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 12px; align-items: start; }
.column { background: var(--panel); border-radius: 4px; padding: 8px; min-height: 200px; }
.column.over { outline: 2px dashed var(--blue); }
.column h3 { margin: 4px 4px 10px; font-size: 12px; text-transform: uppercase; color: var(--muted); letter-spacing: .04em; }
.column h3 .count { background: #dfe1e6; border-radius: 10px; padding: 0 7px; margin-left: 4px; }
.card { background: var(--card); border-radius: 3px; padding: 10px; margin-bottom: 8px; box-shadow: 0 1px 1px rgba(9,30,66,.25); cursor: grab; }
.card:hover { background: #fafbfc; }
.card.dragging { opacity: .4; }
.card .title { margin-bottom: 8px; word-break: break-word; }
.card .row { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.card .labels { margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.label { background: #dfe1e6; border-radius: 3px; padding: 0 6px; font-size: 11px; font-weight: 600; color: #42526e; }
.key { font-weight: 600; }
.points { background: var(--panel); border-radius: 10px; padding: 0 7px; font-weight: 600; }
.avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.avatar.none { background: #c1c7d0; }
.type { width: 16px; height: 16px; border-radius: 3px; display: inline-block; color: #fff; font-size: 11px; text-align: center; line-height: 16px; font-weight: 700; }
.type.Story { background: #36b37e; } .type.Bug { background: #e5493a; } .type.Task { background: #4bade8; } .type.Epic { background: #904ee2; }
.prio { font-weight: 700; }
.prio.Highest { color: #cd1317; } .prio.High { color: #e9494a; } .prio.Medium { color: #e97f33; } .prio.Low { color: #2d8738; } .prio.Lowest { color: #55a557; }

table.list { width: 100%; border-collapse: collapse; background: #fff; border-radius: 4px; overflow: hidden; }
table.list th, table.list td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
table.list th { font-size: 12px; text-transform: uppercase; color: var(--muted); background: #fafbfc; }
table.list tr.item { cursor: pointer; } table.list tr.item:hover { background: #f4f5f7; }
.status-pill { background: var(--panel); border-radius: 3px; padding: 1px 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.status-pill.Done { background: #e3fcef; color: #006644; } .status-pill.In-Progress { background: #deebff; color: #0747a6; } .status-pill.In-Review { background: #eae6ff; color: #403294; }
.empty { color: var(--muted); padding: 24px; text-align: center; }

dialog { border: 0; border-radius: 4px; padding: 0; width: min(820px, 94vw); box-shadow: 0 8px 24px rgba(9,30,66,.4); }
dialog::backdrop { background: rgba(9,30,66,.54); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.dlg-head h2 { margin: 0; font-size: 18px; }
.close { font-size: 22px; background: none; padding: 0 8px; }
.dlg-body { display: grid; grid-template-columns: 1fr 240px; gap: 20px; padding: 16px 20px; max-height: 70vh; overflow: auto; }
.dlg-body label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
.dlg-body input, .dlg-body select, .dlg-body textarea { display: block; width: 100%; margin-top: 4px; padding: 7px 8px; border: 2px solid var(--border); border-radius: 3px; background: #fff; font-weight: 400; color: var(--text); }
.dlg-foot { display: flex; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); }
#comments { list-style: none; padding: 0; margin: 0 0 8px; }
#comments li { background: var(--bg); border-radius: 3px; padding: 8px 10px; margin-bottom: 6px; }
#comments .when { color: var(--muted); font-size: 11px; }
.comment-add { display: flex; gap: 8px; align-items: flex-start; }
.comment-add textarea { flex: 1; padding: 7px 8px; border: 2px solid var(--border); border-radius: 3px; }
.meta { color: var(--muted); font-size: 11px; }

@media (max-width: 900px) { .board { grid-template-columns: 1fr 1fr; } .dlg-body { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .board { grid-template-columns: 1fr; } }
