/* Columns, cards, inline composers, and pointer drag & drop. */

.board-columns {
  height: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

/* ---------- Column ---------- */
.column {
  width: 288px;
  flex-shrink: 0;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.column-head {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 9px 8px 6px 10px;
}
.column-grip {
  cursor: grab;
  display: flex;
  color: var(--ink-faint);
  font-size: 12px;
  padding: 4px 2px;
  touch-action: none;
  user-select: none;
}
.column-head:hover .column-grip { color: var(--ink-soft); }

.column-title {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: 13px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  padding: 4px 6px;
  background: transparent;
}
.column-title:hover { background: var(--surface-sunk); }
.column-title:focus { outline: none; background: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }

.column-count {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--surface-alt);
  border-radius: 999px;
  padding: 1px 8px;
}
.column-menu { flex-shrink: 0; }

.column-cards {
  list-style: none;
  overflow-y: auto;
  padding: 2px 8px;
  flex: 1;
  min-height: 6px;
  scrollbar-width: thin;
}
.column-cards.empty-filtered { padding-bottom: 8px; }
.cards-none { font-size: 12px; font-style: italic; color: var(--ink-faint); padding: 6px 4px; }

.add-card {
  margin: 4px 8px 8px;
  border: none;
  background: none;
  color: var(--ink-soft);
  text-align: left;
  padding: 8px 8px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 13px;
  transition: background var(--t-fast), color var(--t-fast);
}
.add-card:hover { background: var(--surface-alt); color: var(--ink); }

/* ---------- Column: add new ---------- */
.column-add {
  width: 288px;
  flex-shrink: 0;
  border-radius: var(--r-lg);
}
.column-add > button {
  width: 100%;
  border: 1px dashed var(--line-strong);
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink-soft);
  text-align: left;
  padding: 11px 12px;
  border-radius: var(--r-lg);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.column-add > button:hover { background: #fff; color: var(--ink); border-color: var(--brand); }

/* ---------- Card ---------- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 8px 10px;
  margin-bottom: 7px;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  font-size: 13px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform 0.05s ease;
}
.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.card:active { transform: translateY(1px); }
.card:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

.card-cover { height: 30px; border-radius: var(--r-md) var(--r-md) 0 0; margin: -8px -10px 8px; }

.card-labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.card-label {
  height: 8px;
  min-width: 34px;
  border-radius: 999px;
  font-size: 0;
  transition: height var(--t-fast), font-size var(--t-fast);
}
.card:hover .card-label,
.card-label.named {
  height: auto;
  min-height: 16px;
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  color: rgba(0, 0, 0, 0.7);
  padding: 0 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-title { white-space: pre-wrap; word-break: break-word; padding-right: 14px; }

/* Open/Done status toggle, in front of the title. While open it only shows on
   hover/focus (Trello-style); once done it stays as a green check. */
.card-head { display: flex; align-items: flex-start; }
.card-head .card-title { flex: 1; min-width: 0; }
.card-status {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 0;
  height: 18px;
  margin-top: -1px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink-faint);
  cursor: pointer;
  overflow: hidden;
  opacity: 0;
  transition: width var(--t-fast), margin var(--t-fast), opacity var(--t-fast), color var(--t-fast);
}
.card:hover .card-status,
.card:focus-within .card-status,
.card-status.done { width: 18px; margin-right: 5px; opacity: 1; }
.card-status:hover { color: var(--ok-ink); }
.card-status:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.card-status.done { color: var(--ok-ink); }
span.card-status { cursor: default; }
@media (hover: none) { .card-status { width: 18px; margin-right: 5px; opacity: 1; } }
.card.is-done .card-title { color: var(--ink-soft); }

.card-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 7px; }
.card-assignees { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.avatar-sm { width: 20px; height: 20px; font-size: 9px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--ink-soft);
  background: var(--surface-alt);
  border-radius: 5px;
  padding: 1px 5px;
}
.badge.clickable { cursor: pointer; }
.badge.private { background: var(--warn-tint); color: var(--warn-ink); }
.badge.due-overdue { background: var(--danger-tint); color: var(--danger); }
.badge.due-today, .badge.due-soon { background: var(--warn-tint); color: var(--warn-ink); }
.badge.due-done, .badge.checklist-done { background: var(--ok-tint); color: var(--ok-ink); }
.badge.due-done { text-decoration: line-through; }

.card-grip {
  position: absolute;
  top: 3px;
  right: 3px;
  display: flex;
  font-size: 11px;
  line-height: 1;
  padding: 2px 3px;
  border-radius: 4px;
  color: var(--ink-faint);
  cursor: grab;
  opacity: 0;
  touch-action: none;
  user-select: none;
  transition: opacity var(--t-fast), background var(--t-fast);
}
.card:hover .card-grip { opacity: 0.7; }
.card-grip:hover { opacity: 1; background: var(--surface-alt); }
@media (hover: none) { .card-grip { opacity: 0.7; } }

/* ---------- Inline composer (add card / add list) ---------- */
.composer { padding: 8px; }
.composer textarea {
  width: 100%;
  border: 1px solid var(--brand);
  border-radius: var(--r-md);
  padding: 8px 10px;
  font-size: 13px;
  resize: none;
  box-shadow: 0 0 0 3px var(--ring);
  outline: none;
}
.composer-actions { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.composer-actions .btn { min-height: 32px; }
.composer-cancel {
  border: none;
  background: none;
  display: inline-flex;
  align-items: center;
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}

/* ---------- Drag & drop ---------- */
.drag-ghost {
  position: fixed;
  z-index: 900;
  margin: 0;
  list-style: none;
  pointer-events: none;
  opacity: 0.96;
  transform: rotate(2.5deg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.drag-hidden { display: none !important; }
.card-placeholder {
  margin-bottom: 7px;
  border-radius: var(--r-md);
  background: var(--brand-tint);
  border: 2px dashed color-mix(in srgb, var(--brand) 40%, transparent);
}
.column-placeholder {
  flex-shrink: 0;
  align-self: stretch;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.55);
  border: 2px dashed var(--line-strong);
}
body.dragging, body.dragging * { cursor: grabbing !important; user-select: none; }

/* ---------- Read-only (viewer) board ---------- */
.viewer .add-card,
.viewer .column-add,
.viewer .card-grip,
.viewer .column-grip,
.viewer .column-menu,
.viewer .board-del { display: none !important; }
.viewer .column-title,
.viewer .card { cursor: default; }
.viewer .column-title:hover { background: transparent; }

/* Custom-field badges ("Tampilkan di card") */
.badge.field-chip { color: #fff; font-weight: 600; text-shadow: 0 1px 1px rgb(0 0 0 / 0.2); }
.badge.field-link { text-decoration: none; color: var(--brand); }
.badge.field-link:hover { text-decoration: underline; }
.badge.field-text { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
