:root {
  --bg: #f5f6fa;
  --panel: #ffffff;
  --text: #2c3e50;
  --muted: #7f8c9b;
  --primary: #4c86f4;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  background: var(--panel);
  border-bottom: 1px solid #e3e7ee;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar h1 { font-size: 20px; margin: 0; }
.topbar-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

button {
  border: 1px solid #d4dae3;
  background: var(--panel);
  color: var(--text);
  border-radius: var(--radius);
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
}

button:hover { border-color: var(--primary); color: var(--primary); }
button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
button.primary:hover { filter: brightness(1.08); color: #fff; }

.icon-btn {
  border: none;
  background: transparent;
  font-size: 22px;
  padding: 0 6px;
  color: var(--muted);
}
.icon-btn:hover { color: var(--text); }

#input-token { padding: 8px; border: 1px solid #d4dae3; border-radius: var(--radius); }

.board {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 20px;
  overflow-x: auto;
  min-height: 70vh;
}

.column {
  flex: 0 0 280px;
  background: #eceff4;
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 140px);
}

.column-header {
  font-weight: 600;
  font-size: 14px;
  padding: 6px 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.column-header .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}

.column-header .count {
  background: #fff;
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 12px;
  color: var(--muted);
}

.column.drag-over { background: #e3edfc; outline: 2px dashed var(--primary); }

.cards { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }

.card {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 12px;
  cursor: grab;
  font-size: 13px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.card.dragging { opacity: 0.45; transform: scale(1.03); }
.board.dragging-active { cursor: grabbing; }

.card-name { font-weight: 600; margin-bottom: 4px; }
.card-meta { color: var(--muted); font-size: 12px; line-height: 1.5; }
.card-total { font-weight: 600; margin-top: 6px; }
.card-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.card-actions .qa {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
}
.card-actions .qa.off { background: #e2e5ea; color: #9aa1ab; pointer-events: none; }
.card-actions .qa:hover { filter: brightness(1.1); }
.card-tags { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

.tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  background: #eef1f6;
  color: var(--muted);
}
.tag.email-sent { background: #e4f3ec; color: #237a4a; }
.tag.recovered { background: #3db46a; color: #fff; }
.tag.pending { background: #fdf1dc; color: #9a6b00; }

.hint { padding: 0 20px 20px; color: var(--muted); font-size: 13px; }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(23, 32, 45, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.overlay.hidden { display: none; }

.modal {
  background: var(--panel);
  border-radius: 12px;
  width: min(640px, 92vw);
  max-height: 88vh;
  overflow: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #eef1f6;
}
.modal-header h2 { margin: 0; font-size: 18px; }
.modal-body { padding: 20px; }
.modal-body label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.modal-body input,
.modal-body textarea,
.modal-body select {
  width: 100%;
  margin-top: 4px;
  padding: 8px;
  border: 1px solid #d4dae3;
  border-radius: var(--radius);
  font-size: 14px;
}
.modal-body textarea { min-height: 120px; resize: vertical; }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.item-list { list-style: none; padding: 0; margin: 8px 0 0; }
.item-list li {
  padding: 8px 10px;
  background: #f7f9fc;
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
}

.actions-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; word-break: break-all; }