:root {
  --bg: #0f1420; --panel: #171e2e; --panel2: #1e293b; --line: #2a3650;
  --fg: #e8edf5; --muted: #8b98b0; --accent: #4f8cff; --accent2: #3b6fd4;
  --new: #6b7280; --in_progress: #d9a441; --done: #3fae6b; --closed: #55627a;
  --high: #ef5b5b; --normal: #4f8cff; --low: #6b7280;
}
* { box-sizing: border-box; }
body {
  margin: 0; font: 15px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg); color: var(--fg);
}
a { color: var(--accent); }
header.top {
  display: flex; align-items: center; gap: 14px; padding: 12px 20px;
  background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
}
header.top h1 { font-size: 18px; margin: 0; font-weight: 650; }
header.top .grow { flex: 1; }
.btn {
  background: var(--accent); color: #fff; border: 0; border-radius: 8px;
  padding: 8px 14px; font-size: 14px; cursor: pointer; font-weight: 550;
}
.btn:hover { background: var(--accent2); }
.btn.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--panel2); }
.btn.danger { background: transparent; color: var(--high); border: 1px solid var(--high); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.wrap { max-width: 860px; margin: 0 auto; padding: 22px 20px 80px; }

input, textarea, select {
  width: 100%; background: var(--bg); color: var(--fg); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 11px; font: inherit;
}
textarea { resize: vertical; min-height: 90px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 5px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; margin-bottom: 14px;
}
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pill {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px;
  font-weight: 600; color: #fff;
}
.pill.new { background: var(--new); } .pill.in_progress { background: var(--in_progress); }
.pill.done { background: var(--done); } .pill.closed { background: var(--closed); }
.prio { font-size: 12px; font-weight: 700; }
.prio.high { color: var(--high); } .prio.normal { color: var(--normal); } .prio.low { color: var(--low); }

/* ticket list */
.tlist .titem {
  display: flex; gap: 12px; align-items: center; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px; margin-bottom: 9px;
  background: var(--panel); cursor: pointer;
}
.tlist .titem:hover { border-color: var(--accent); }
.tlist .titem .t-title { font-weight: 600; }
.tlist .titem .grow { flex: 1; }

/* paste/drop zone + thumbnails */
.dropzone {
  border: 1px dashed var(--line); border-radius: 8px; padding: 10px; margin-top: 8px;
  color: var(--muted); font-size: 13px; text-align: center; cursor: pointer;
}
.dropzone.hover { border-color: var(--accent); color: var(--fg); }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.thumbs .thumb { position: relative; }
.thumbs img { height: 72px; border-radius: 6px; border: 1px solid var(--line); display: block; }
.thumbs .x {
  position: absolute; top: -7px; right: -7px; background: var(--high); color: #fff;
  border: 0; border-radius: 999px; width: 20px; height: 20px; cursor: pointer; line-height: 1;
}

/* comments */
.comment { border-top: 1px solid var(--line); padding: 12px 0; }
.comment.admin .c-author { color: var(--accent); }
.comment .c-author { font-weight: 650; }
.att { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.att img { max-height: 220px; max-width: 100%; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; }
.body-text { white-space: pre-wrap; word-break: break-word; }

/* modal */
.overlay {
  position: fixed; inset: 0; background: rgba(4, 8, 16, .68); display: none;
  align-items: flex-start; justify-content: center; padding: 30px 16px; overflow: auto; z-index: 20;
}
.overlay.show { display: flex; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  width: 100%; max-width: 680px; padding: 22px; }
.modal h2 { margin: 0 8px 0 0; font-size: 20px; }
.modal .head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }

/* image lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.9); display: none;
  align-items: center; justify-content: center; z-index: 40; cursor: zoom-out; }
.lightbox.show { display: flex; }
.lightbox img { max-width: 94vw; max-height: 94vh; }

/* kanban */
.board { display: flex; gap: 14px; padding: 20px; align-items: flex-start; overflow-x: auto; }
.col { background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  width: 300px; min-width: 300px; flex-shrink: 0; }
.col h3 { margin: 0; padding: 12px 14px; font-size: 14px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; }
.col .count { color: var(--muted); font-weight: 500; }
.col .drop { padding: 10px; min-height: 60px; }
.col .drop.over { background: var(--panel2); }
.kcard {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 12px; margin-bottom: 10px; cursor: grab;
}
.kcard:hover { border-color: var(--accent); }
.kcard.dragging { opacity: .4; }
.kcard .k-title { font-weight: 600; margin-bottom: 4px; }
.kcard .k-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.badge { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 11px; }
.err { color: var(--high); font-size: 13px; margin-top: 8px; }
.empty { color: var(--muted); text-align: center; padding: 40px; }
