/* ── Reset & Variables ──────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0e0e10;
  --surface: #18181b;
  --surface-raised: #1e1e22;
  --border: #2a2a2e;
  --border-hover: #3a3a40;
  --text: #e4e4e7;
  --text-muted: #71717a;
  --accent: #f97316;
  --accent-dim: rgba(249, 115, 22, 0.12);
  --accent-glow: rgba(249, 115, 22, 0.25);
  --danger: #ef4444;
  --radius: 8px;
  --radius-lg: 12px;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --col-width: 300px;
  --transition: 160ms ease;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: auto;
  overflow-y: hidden;
}

/* ── Header ────────────────────────────────────────── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}

.logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 2px;
  color: var(--accent);
}

.btn-add-col {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border: 1px dashed var(--border-hover);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-add-col:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* ── Board ─────────────────────────────────────────── */
.board {
  display: flex;
  gap: 16px;
  padding: 24px;
  height: calc(100vh - 57px);
  overflow-x: auto;
  overflow-y: hidden;
  align-items: flex-start;
}

/* ── Column ────────────────────────────────────────── */
.column {
  flex: 0 0 var(--col-width);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.column.drag-over {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}

.column-title {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 2px 6px;
  outline: none;
  cursor: pointer;
  flex: 1;
  min-width: 0;
  transition: all var(--transition);
}

.column-title:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.column-title:focus {
  border-color: var(--accent);
  color: var(--text);
  cursor: text;
}

.column-stats {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.column-actions {
  display: flex;
  gap: 4px;
}

.col-action-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all var(--transition);
}

.col-action-btn:hover {
  background: var(--surface-raised);
  color: var(--text);
}

.col-action-btn.delete:hover {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

.column-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 60px;
}

.column-body::-webkit-scrollbar {
  width: 4px;
}

.column-body::-webkit-scrollbar-track {
  background: transparent;
}

.column-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

/* ── Drop placeholder ──────────────────────────────── */
.drop-placeholder {
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
  background: var(--accent-dim);
  min-height: 48px;
  transition: all var(--transition);
}

/* ── Task Card ─────────────────────────────────────── */
.task-card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: grab;
  transition: all var(--transition);
  position: relative;
  user-select: none;
}

.task-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.task-card:active {
  cursor: grabbing;
}

.task-card.dragging {
  opacity: 0.4;
  transform: scale(0.96);
}

.task-card-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
  word-break: break-word;
}

.task-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 8px;
  word-break: break-word;
}

.task-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.task-points {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--accent-dim);
  color: var(--accent);
}

.task-points.zero {
  background: rgba(113, 113, 122, 0.12);
  color: var(--text-muted);
}

.task-card-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity var(--transition);
}

.task-card:hover .task-card-actions {
  opacity: 1;
}

.task-action-btn {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all var(--transition);
}

.task-action-btn:hover {
  background: var(--surface);
  color: var(--text);
}

.task-action-btn.delete:hover {
  color: var(--danger);
}

/* ── Add task button ───────────────────────────────── */
.btn-add-task {
  width: 100%;
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 4px;
}

.btn-add-task:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* ── Modal ─────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 440px;
  max-width: 90vw;
  transform: translateY(12px) scale(0.97);
  transition: transform 200ms ease;
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--surface-raised);
  color: var(--text);
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-body label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.modal-body input[type="text"],
.modal-body textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
  resize: vertical;
}

.modal-body input[type="text"]:focus,
.modal-body textarea:focus {
  border-color: var(--accent);
}

.modal-body input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
  -moz-appearance: textfield;
}

.modal-body input[type="number"]:focus {
  border-color: var(--accent);
}

.modal-body input[type="number"]::-webkit-inner-spin-button,
.modal-body input[type="number"]::-webkit-outer-spin-button {
  opacity: 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.btn-cancel {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-cancel:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.btn-save {
  padding: 8px 20px;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-save:hover {
  filter: brightness(1.1);
}

/* ── Utility ───────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
