/* Tasks. Same tokens and the same square, ruled look as the rest. */

.tasks-page { height: 100%; overflow-y: auto; }

/* Status is the one place a task table has to be read at a glance, so each
   status has its own shape of pill rather than its own colour. */
.task-status {
  display: inline-block; padding: 2px 8px; font-size: 11px; font-weight: 600; letter-spacing: .02em; white-space: nowrap;
  border: 1px solid var(--color-neutral-400, var(--color-divider)); color: var(--color-neutral-700);
}
.crm-row > .task-status { justify-self: start; }
.task-status--working { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-bg); }
.task-status--stuck { background: var(--color-text); border-color: var(--color-text); color: var(--color-bg); }
.task-status--done { border-style: dashed; color: var(--color-neutral-600); }
.task-status--done::before { content: '\2713  '; }

.task-owner { display: inline-flex; align-items: center; gap: 8px; }
.task-owner .people-avatar { width: 24px; height: 24px; font-size: 10px; flex: none; }
.task-overdue { color: var(--color-accent); font-weight: 600; }
.task-row--done strong { font-weight: 400; color: var(--color-neutral-600); text-decoration: line-through; }

/* The task window: over the table, wide enough for the two columns of a card. */
.task-window {
  width: min(1120px, 100%); max-height: 90vh; overflow-y: auto;
  background: var(--color-bg); border: 1px solid var(--color-divider); box-shadow: var(--shadow-lg);
}
.task-window-head {
  position: sticky; top: 0; z-index: 1; background: var(--color-bg);
  padding: var(--space-4) var(--space-6); border-bottom: 2px solid var(--color-divider);
}
.task-window-body { padding: 0 var(--space-6) var(--space-6); }
.task-window .people-select { width: 100%; }
.task-made { margin-top: var(--space-4); }

.task-subtasks { border-top: 1px solid var(--color-divider); }
.task-subtask { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--color-divider); }
.task-subtask > button:first-child { flex: 1; border-bottom: 0; }
.task-add { display: flex; flex-direction: column; gap: 6px; margin: var(--space-3) 0; }
.task-add .input { width: 100%; }
.task-updates { border-top: 1px solid var(--color-divider); }
.task-update { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--color-divider); font-size: 13px; }
.task-update .people-avatar { flex: none; }
.task-activity { grid-template-columns: 84px minmax(0, 1fr); }
.task-linked { gap: 10px; }
.task-linked > span:first-child { width: auto; }
.crm-doc .crm-source { display: inline; padding: 0; }
.crm-doc > .btn { margin-left: auto; }
/* The window is taller than a command palette, so it starts nearer the top. */
.palette-backdrop:has(.task-window) { padding-top: 5vh; }
