/* Left rail: pinned projects */
.rail-pinned { margin: 8px 0 2px; }
.rail-pinned .pin-item {
  display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 8px;
  font-size: 13px; color: var(--text-muted); text-decoration: none; font-weight: 500;
}
.rail-pinned .pin-item:hover { background: var(--primary-50); color: var(--text); text-decoration: none; }
.rail-pinned .pin-item.active { background: var(--primary-50); color: var(--primary-800); font-weight: 600; }
.rail-pinned .pin-item .dot { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.rail-pinned .pin-item .pin-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-pinned .pin-item .pin-count { margin-left: auto; font-size: 10px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.rail-empty { font-size: 11.5px; color: var(--text-faint); padding: 6px 10px 10px; line-height: 1.5; }

/* Board canvas */
.board-page { display: flex; flex-direction: column; min-height: calc(100vh - var(--header-h)); }
.content.board-content { max-width: none; padding: 0; }

.board-head {
  display: flex; align-items: center; gap: 12px; padding: 14px 22px;
  border-bottom: 1px solid var(--border); background: var(--surface); flex-wrap: wrap;
}
.board-head .titles { min-width: 0; flex: 1 1 240px; }
.board-head h1 { font-size: 18px; display: flex; align-items: center; gap: 9px; }
.board-head .sub { color: var(--text-muted); font-size: 12.5px; margin-top: 2px; }
.board-head .actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.board-head .board-icon {
  width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center;
  justify-content: center; color: #fff; flex: none;
}
.board-head .board-icon svg { width: 17px; height: 17px; }

.board-tabs { display: flex; align-items: center; gap: 2px; overflow-x: auto; padding: 0 14px; background: var(--surface); border-bottom: 1px solid var(--border); }
.board-tabs .tab { padding: 10px 12px; }
.board-tabs .spacer { flex: 1; }
.board-tabs .meta { font-size: 12px; color: var(--text-muted); padding-right: 6px; display: flex; gap: 12px; align-items: center; }

.board-scroll {
  display: flex; gap: 14px; align-items: flex-start; padding: 16px 20px 26px;
  overflow-x: auto; overflow-y: hidden; flex: 1; min-height: 0;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg) 100%);
  scrollbar-gutter: stable;
}
.board-scroll::-webkit-scrollbar { height: 10px; }
.board-scroll::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; }

.kanban-col {
  width: auto; flex: 1 1 240px; min-width: 230px; max-width: 340px; max-height: 100%; display: flex; flex-direction: column;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  max-height: calc(100vh - var(--header-h) - 140px);
}
.kanban-col.col-add { background: transparent; border-style: dashed; max-height: none; flex: 0 0 160px; min-width: 150px; max-width: 170px; }
.kanban-col-head {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px 8px; position: sticky; top: 0;
  border-radius: 12px 12px 0 0; background: var(--surface-2); z-index: 2;
}
.kanban-col-head .col-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.kanban-col-head .col-name { font-size: 12.5px; font-weight: 700; letter-spacing: .01em; color: var(--text); }
.kanban-col-head .col-count { font-size: 11px; color: var(--text-muted); background: #E9EEF6; border-radius: 999px; padding: 1px 7px; font-variant-numeric: tabular-nums; }
.kanban-col-head .col-actions { margin-left: auto; display: flex; gap: 1px; }
.kanban-col-head .btn-icon { width: 26px; height: 26px; }
.kanban-cards {
  display: flex; flex-direction: column; gap: 8px; padding: 4px 9px 10px; overflow-y: auto; min-height: 30px;
}
.kanban-cards.drag-over { background: var(--primary-50); border-radius: 9px; outline: 2px dashed var(--primary-300, #9DB6E4); outline-offset: -4px; }
.col-empty { padding: 14px 8px; text-align: center; font-size: 11.5px; color: var(--text-faint); }

.k-card {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 11px 9px; box-shadow: 0 1px 2px rgba(15,23,42,.04); cursor: pointer;
  transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
  border-left: 3px solid transparent;
}
.k-card:hover { border-color: var(--primary-500); box-shadow: 0 4px 14px rgba(18,58,125,.10); }
.k-card.dragging { opacity: .45; }
.k-card .card-top { display: flex; align-items: flex-start; gap: 6px; }
.k-card .card-title { font-size: 13px; font-weight: 600; line-height: 1.4; flex: 1; min-width: 0; word-break: break-word; }
.k-card .card-desc { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.k-card .card-kebab { opacity: 0; width: 24px; height: 24px; flex: none; }
.k-card:hover .card-kebab { opacity: 1; }
.k-card .card-labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.k-label { font-size: 10px; font-weight: 650; padding: 1px 7px; border-radius: 999px; color: #fff; line-height: 1.6; white-space: nowrap; }
.k-card .card-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.k-card .card-meta { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; color: var(--text-faint); }
.k-card .card-meta svg { width: 12px; height: 12px; }
.k-card .card-meta.due-over { color: var(--danger); font-weight: 600; }
.k-card .card-meta.due-soon { color: var(--warning); font-weight: 600; }
.k-card .card-meta.done { color: var(--success); }
.k-card .card-foot .avatar-stack { margin-left: auto; }
.k-card .av { width: 20px; height: 20px; font-size: 8.5px; }
.k-card .progress-line { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--text-faint); margin-top: 7px; }
.k-card .progress-line .progress { flex: 1; height: 4px; }
.k-card .project-pct { font-size: 10.5px; font-weight: 700; color: var(--text-muted); }
.k-card .p-card-dot { width: 8px; height: 8px; border-radius: 3px; flex: none; margin-top: 4px; }
.k-card .due-chip {
  display: inline-flex; align-items: center; gap: 3px; font-size: 10px; padding: 1px 6px; border-radius: 999px;
  background: #F1F4F9; color: var(--text-muted); border: 1px solid var(--border);
}

.col-add-btn {
  display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: transparent;
  color: var(--text-muted); font-size: 12px; font-weight: 550; padding: 8px 10px; border-radius: 8px; text-align: left;
}
.col-add-btn:hover { background: var(--primary-50); color: var(--primary-800); }
.col-add-btn svg { width: 14px; height: 14px; }

.inline-add { padding: 6px 9px 10px; }
.inline-add textarea { min-height: 58px; font-size: 12.5px; }
.inline-add .row { display: flex; gap: 6px; margin-top: 6px; }

.project-status-tabs { display: flex; gap: 4px; padding: 2px; background: var(--primary-50); border-radius: 9px; }
.project-status-tabs button { border: 0; background: transparent; padding: 5px 9px; border-radius: 7px; font-size: 11.5px; font-weight: 600; color: var(--text-muted); }
.project-status-tabs button[aria-pressed="true"] { background: var(--surface); color: var(--primary-800); box-shadow: 0 1px 2px rgba(15,23,42,.08); }

@media (max-width: 860px) {
  .kanban-col { flex: 0 0 270px; min-width: 270px; max-width: 270px; }
  .board-head { padding: 12px 14px; }
  .board-scroll { padding: 12px 12px 20px; }
}

/* ---------- Refined task cards ---------- */
.k-card { padding: 9px 11px 8px; border-left-width: 3px; border-left-style: solid; }
.k-card .card-cover { height: 4px; margin: -9px -11px 8px; border-radius: 9px 9px 0 0; }
.k-card .card-top { gap: 7px; }
.k-card .card-title {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 12.5px; line-height: 1.38; font-weight: 600; overflow-wrap: anywhere;
}
.k-card .card-desc { font-size: 11.5px; line-height: 1.45; overflow-wrap: anywhere; }
.task-check {
  width: 18px; height: 18px; border: 0; background: none; padding: 0; display: flex;
  align-items: center; justify-content: center; flex: none; margin-top: 1px; color: #fff;
}
.task-check-box {
  width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center; background: var(--surface);
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.task-check-box svg { width: 10px; height: 10px; opacity: 0; transform: scale(.8); transition: .15s ease; }
.task-check:hover .task-check-box { border-color: var(--success); background: var(--success-bg); }
.task-check.done .task-check-box { background: var(--success); border-color: var(--success); }
.task-check.done .task-check-box svg { opacity: 1; transform: scale(1); }
.task-check:active .task-check-box { transform: scale(.93); }
.k-card .card-kebab { opacity: 0; margin: -4px -4px 0 0; transition: opacity .12s ease; }
.k-card:hover .card-kebab, .k-card:focus-within .card-kebab { opacity: 1; }
.k-card .card-foot { border-top: 1px solid var(--border); padding-top: 7px; margin-top: 8px; gap: 7px; }
.card-foot-spacer { flex: 1 1 auto; }
.card-assignees { display: flex; align-items: center; flex: none; }
.card-meta.muted { color: var(--text-faint); }
.avatar.av.unassigned { background: var(--surface-2); border: 1px dashed var(--border-strong); color: var(--text-faint); }
.avatar.av.unassigned svg { width: 11px; height: 11px; }
.k-card.is-done { opacity: .86; }
.k-card.is-done .card-desc { opacity: .7; }
.k-card .card-labels { margin-top: 1px; }
@media (hover: none) { .k-card .card-kebab { opacity: 1; } }
.card-action-menu {
  position: fixed; z-index: 180; min-width: 184px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-lg); animation: pop-in .12s ease;
}
/* Keep the board canvas filling the viewport inside its view wrapper */
.board-page > [data-view-content] { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.move-list { display: flex; flex-direction: column; gap: 6px; }
.move-option {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 10px 11px;
  border: 1px solid var(--border); background: var(--surface); border-radius: 9px;
  text-align: left; font-size: 13px; color: var(--text);
}
.move-option:hover { border-color: var(--primary-500); background: var(--primary-50); }
.move-option.current { border-color: var(--primary-500); background: var(--primary-50); }