* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", "SF Mono", Consolas, monospace; background: #0a0e1a; color: #d0d7ff; }

/* ---------- Header ---------- */
header {
  padding: 16px 24px;
  background: #131b2d;
  border-bottom: 1px solid #1e2c4a;
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  flex-wrap: wrap;
}
.brand h1 { margin: 0; font-size: 22px; color: #7ee8fa; font-weight: 600; }
.brand .sub { color: #6fdc8c; font-size: 12px; }
.tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tools input, .tools select {
  background: #0a0e1a; color: #d0d7ff; border: 1px solid #1e2c4a; padding: 8px 12px; border-radius: 4px; font-size: 13px; font-family: inherit;
}
.tools input[type="text"] { min-width: 300px; }
.btn-secondary { background: #1e2c4a; color: #7ee8fa; padding: 8px 14px; border-radius: 4px; text-decoration: none; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.btn-secondary:hover { background: #2a3a5f; }

/* ---------- Board ---------- */
.board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  padding: 20px;
  min-height: calc(100vh - 90px);
}
.column {
  background: #131b2d;
  border: 1px solid #1e2c4a;
  border-radius: 6px;
  display: flex; flex-direction: column;
  min-height: 200px;
}
.column-header {
  padding: 12px 16px;
  border-bottom: 1px solid #1e2c4a;
  background: linear-gradient(180deg, #1a2340 0%, #131b2d 100%);
  border-radius: 6px 6px 0 0;
}
.column-title { font-weight: 600; color: #7ee8fa; font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; display: flex; justify-content: space-between; }
.column-title .count { background: #1e2c4a; color: #a5b4ff; padding: 2px 8px; border-radius: 10px; font-size: 11px; }
.column-desc { color: #4a5788; font-size: 11px; margin-top: 3px; }
.column-body { padding: 10px; flex: 1; min-height: 100px; }

/* ---------- Card ---------- */
.card {
  background: #1a2340;
  border: 1px solid #2a3a5f;
  border-left: 3px solid #4a5788;
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.4); }
.card.prio-1 { border-left-color: #ffb84d; }
.card.prio-2 { border-left-color: #ff6b6b; }
.card.prio-3 { border-left-color: #ff2d55; box-shadow: 0 0 0 1px rgba(255,45,85,0.3); }

.card-header { display: flex; gap: 6px; margin-bottom: 6px; font-size: 11px; flex-wrap: wrap; }
.card-id { color: #4a5788; font-family: monospace; }
.prio-badge { color: #ffb84d; }
.cat-badge { background: #1e2c4a; color: #7ee8fa; padding: 1px 6px; border-radius: 2px; font-size: 10px; }
.card-title { color: #d0d7ff; font-weight: 500; margin-bottom: 4px; font-size: 13px; line-height: 1.4; }
.card-desc { color: #6a7ab0; font-size: 11px; line-height: 1.4; margin-bottom: 6px; }
.card-meta { display: flex; gap: 10px; font-size: 10px; color: #6a7ab0; flex-wrap: wrap; }
.card-meta .due { color: #a5b4ff; }
.card-meta .due.overdue { color: #ff6b6b; font-weight: 600; }
.card-meta .subs, .card-meta .comments { color: #7ee8fa; }

.ghost { opacity: 0.4; }
.dragging { opacity: 0.7; }

/* ---------- Modal ---------- */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 100;
  padding: 40px 20px;
  overflow-y: auto;
}
.modal-overlay.open { display: block; }
.modal {
  max-width: 700px; margin: 0 auto;
  background: #131b2d;
  border: 1px solid #1e2c4a;
  border-radius: 8px;
  padding: 32px;
  position: relative;
}
.modal-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none; color: #6a7ab0; font-size: 24px; cursor: pointer;
}
.modal-close:hover { color: #ff6b6b; }
.m-head { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.tag { background: #1e2c4a; color: #7ee8fa; padding: 3px 8px; border-radius: 3px; font-size: 11px; font-family: monospace; }
.tag.status { background: #14283d; color: #6fdc8c; }
.modal h2 { color: #d0d7ff; margin: 0 0 16px; font-weight: 500; padding: 8px; border-radius: 4px; }
.modal h2:hover, .modal h2:focus { background: #1a2340; outline: none; }
.lbl { display: block; font-size: 11px; color: #7ee8fa; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 20px; margin-bottom: 6px; }
.edit-block {
  background: #0a0e1a; border: 1px solid #1e2c4a; padding: 10px; border-radius: 4px;
  min-height: 40px; color: #d0d7ff; font-size: 13px; white-space: pre-wrap;
}
.edit-block:focus { outline: none; border-color: #7ee8fa; }

.subtasks { list-style: none; padding: 0; margin: 0; }
.subtasks li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 10px; background: #1a2340; margin-bottom: 4px; border-radius: 3px;
}
.subtasks label { flex: 1; display: flex; gap: 8px; align-items: center; cursor: pointer; }
.subtasks input[type="checkbox"] { accent-color: #6fdc8c; }
.subtasks .done { text-decoration: line-through; color: #4a5788; }
.mini-del { background: none; border: none; color: #6a7ab0; cursor: pointer; font-size: 14px; padding: 0 6px; }
.mini-del:hover { color: #ff6b6b; }

.comments-list { max-height: 240px; overflow-y: auto; margin-bottom: 8px; }
.comment { background: #1a2340; padding: 8px 12px; margin-bottom: 6px; border-radius: 4px; }
.comment-head { font-size: 10px; color: #7ee8fa; margin-bottom: 3px; }
.comment-head span { color: #4a5788; }
.comment-body { font-size: 13px; color: #d0d7ff; white-space: pre-wrap; }
.empty { color: #4a5788; font-style: italic; padding: 8px 0; font-size: 12px; }

.add-row { display: flex; gap: 6px; margin-top: 6px; }
.add-row input { flex: 1; background: #0a0e1a; border: 1px solid #1e2c4a; padding: 8px 10px; border-radius: 3px; color: #d0d7ff; }
.add-row button { background: #1e2c4a; color: #7ee8fa; border: none; padding: 8px 16px; border-radius: 3px; cursor: pointer; font-family: inherit; }
.add-row button:hover { background: #2a3a5f; }

.danger { margin-top: 24px; padding-top: 16px; border-top: 1px solid #2a1414; }
.btn-danger { background: #3d1414; color: #ff6b6b; border: 1px solid #ff6b6b; padding: 8px 16px; border-radius: 3px; cursor: pointer; font-family: inherit; }
.btn-danger:hover { background: #ff6b6b; color: #131b2d; }

/* ---------- Media / Preview ---------- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-bottom: 8px; }
.media-item { background: #1a2340; border: 1px solid #2a3a5f; border-radius: 4px; padding: 6px; }
.media-item img { width: 100%; height: 140px; object-fit: cover; border-radius: 3px; display: block; cursor: zoom-in; background: #0a0e1a; }
.media-item.file { padding: 12px; display: flex; justify-content: space-between; align-items: center; }
.media-item.file a { color: #7ee8fa; text-decoration: none; }
.media-cap { font-size: 11px; color: #7ee8fa; margin-top: 6px; }
.media-cap > div { margin-bottom: 3px; word-break: break-word; }
.media-links a { color: #a5b4ff; text-decoration: none; margin-right: 6px; }
.media-links a:hover { text-decoration: underline; }
.media-links { display: flex; gap: 6px; align-items: center; font-size: 11px; }
.media-links .mini-del { margin-left: auto; }

.card-media-thumb { margin-top: 6px; display: flex; gap: 4px; overflow: hidden; }
.card-media-thumb img { width: 40px; height: 40px; object-fit: cover; border-radius: 2px; }
.card-media-thumb .more { width: 40px; height: 40px; background: #131b2d; color: #7ee8fa; display: flex; align-items: center; justify-content: center; border-radius: 2px; font-size: 10px; }

/* ---------- Exec-Log ---------- */
.exec-log {
  background: #0a0e1a; color: #6fdc8c;
  border: 1px solid #1e2c4a; border-radius: 4px;
  padding: 10px; font-family: 'SF Mono', Consolas, monospace; font-size: 11px;
  max-height: 200px; overflow-y: auto; white-space: pre-wrap;
}

/* Responsive */
@media (max-width: 1100px) {
  .board { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  .board { grid-template-columns: 1fr; }
  .tools input[type="text"] { min-width: 200px; }
}

/* ---------- Media Uploader ---------- */
.media-uploader {
  background: #131b2d;
  border: 2px dashed #2a3a5f;
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.15s;
}
.media-uploader.drag-over {
  background: #1a2340;
  border-color: #7ee8fa;
  box-shadow: 0 0 12px rgba(126, 232, 250, 0.3);
}
.btn-upload {
  background: linear-gradient(135deg, #7ee8fa, #4a90e2);
  color: #0a0e1a;
  border: none;
  padding: 7px 14px;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
}
.btn-upload:hover { transform: translateY(-1px); }
.drop-hint { color: #6a7896; font-size: 12px; flex: 1; }
.upload-progress { color: #7ee8fa; font-size: 12px; font-weight: 600; min-width: 120px; text-align: right; }

/* Subtask-Preset Dropdown */
.subtask-add { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.subtask-add input[type=text] { flex: 1 1 200px; }
.sub-preset {
  background: #131b2d;
  color: #7ee8fa;
  border: 1px solid #2a3a5f;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 12px;
  cursor: pointer;
  max-width: 260px;
}
.sub-preset:hover { border-color: #7ee8fa; }
.sub-preset option { background: #0a0e1a; color: #d5e0ff; }
