/* ============================================================
   PRIMETOUR — Tasks CSS
   Tarefas, Projetos, Kanban, Calendário, Timeline
   ============================================================ */

/* ─── PRIORITY COLORS ─────────────────────────────────────── */
:root {
  --priority-urgent: #EF4444;
  --priority-high:   #F97316;
  --priority-medium: #F59E0B;
  --priority-low:    #6B7280;

  --status-backlog:     #6B7280;
  --status-todo:        #38BDF8;
  --status-in-progress: #F59E0B;
  --status-review:      #A78BFA;
  --status-done:        #22C55E;
  --status-cancelled:   #EF4444;
}

/* ─── VIEW TOGGLE ─────────────────────────────────────────── */
.view-toggle {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
}
.view-btn {
  padding: 6px 12px;
  border-radius: calc(var(--radius-md) - 2px);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.view-btn:hover { color: var(--text-secondary); background: var(--bg-hover); }
.view-btn.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* ─── TASK LIST VIEW ──────────────────────────────────────── */
.task-list { display: flex; flex-direction: column; gap: 2px; }

.task-row {
  display: grid;
  /* 4.13+: nova primeira coluna 28px = checkbox de bulk-select */
  grid-template-columns: 28px 28px 1fr 110px 130px 110px 90px 100px;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--bg-card);
  margin-bottom: 2px;
}
.task-row.bulk-selected {
  background: rgba(212, 168, 67, 0.08);
  border-color: var(--brand-gold);
}
.task-row .bulk-select-cell:hover {
  background: var(--bg-hover);
}
/* 4.14+: célula com edição inline (status/area/prazo/responsável) */
.task-cell-edit {
  cursor: pointer;
  border-radius: 4px;
  padding: 4px 6px;
  margin: -4px -6px;
  transition: background 0.12s, box-shadow 0.12s;
}
.task-cell-edit:hover {
  background: rgba(212, 168, 67, 0.10);
  box-shadow: inset 0 0 0 1px rgba(212, 168, 67, 0.35);
}
/* Mesma UX no kanban (cards) */
.kb-cell-edit {
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 4px;
  margin: -2px -4px;
  transition: background 0.12s, box-shadow 0.12s;
}
.kb-cell-edit:hover {
  background: rgba(212, 168, 67, 0.12);
  box-shadow: inset 0 0 0 1px rgba(212, 168, 67, 0.35);
}
.task-row:hover {
  background: var(--bg-hover);
  border-color: var(--border-subtle);
}
.task-row.done { opacity: 0.55; }
.task-row.done .task-row-title { text-decoration: line-through; color: var(--text-muted); }

/* Drag and drop */
.task-row[draggable="true"] { cursor: grab; }
.task-row[draggable="true"]:active { cursor: grabbing; }
.task-row.dragging { opacity: 0.4; cursor: grabbing; transform: rotate(1deg) scale(1.01); }
.task-row.drag-insert-above { border-top: 2px solid var(--brand-gold) !important; }
.task-row.drag-insert-below { border-bottom: 2px solid var(--brand-gold) !important; }
.task-group.drag-over { background: rgba(212,168,67,0.06); border-radius: var(--radius-lg); }
.task-group.drag-over .task-group-header { color: var(--brand-gold); }

.task-check {
  width: 18px; height: 18px;
  border: 2px solid var(--border-default);
  border-radius: 50%;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  /* ✓ visível em cinza por padrão (dica visual de "marca aqui pra concluir").
     Muda pra verde no hover, branco no checked. */
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
}
.task-check:hover { border-color: var(--color-success); color: var(--color-success); }
.task-check.checked {
  background: var(--color-success);
  border-color: var(--color-success);
  color: white;
}
.task-check.disabled {
  cursor: not-allowed;
  opacity: 0.35;
  border-style: dashed;
  color: var(--text-muted);
}
.task-check.disabled:hover {
  border-color: var(--border-default);
  color: var(--text-muted);
}

.task-row-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-row-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-list-header {
  display: grid;
  /* 4.13+: nova primeira coluna 28px = master-checkbox bulk-select */
  grid-template-columns: 28px 28px 1fr 110px 130px 110px 90px 100px;
  gap: 12px;
  padding: 8px 16px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 4px;
}

/* ─── PRIORITY BADGE ──────────────────────────────────────── */
.priority-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.priority-urgent { background: var(--priority-urgent); }
.priority-high   { background: var(--priority-high); }
.priority-medium { background: var(--priority-medium); }
.priority-low    { background: var(--priority-low); }

.badge-priority-urgent { background:rgba(239,68,68,0.12);  color:var(--priority-urgent); border:1px solid rgba(239,68,68,0.25); }
.badge-priority-high   { background:rgba(249,115,22,0.12); color:var(--priority-high);   border:1px solid rgba(249,115,22,0.25); }
.badge-priority-medium { background:rgba(245,158,11,0.12); color:var(--priority-medium); border:1px solid rgba(245,158,11,0.25); }
.badge-priority-low    { background:rgba(107,114,128,0.12);color:var(--priority-low);    border:1px solid rgba(107,114,128,0.25); }

/* ─── STATUS BADGE ────────────────────────────────────────── */
.badge-status-backlog     { background:rgba(107,114,128,0.12); color:var(--status-backlog);     border:1px solid rgba(107,114,128,0.25); }
.badge-status-todo        { background:rgba(56,189,248,0.12);  color:var(--status-todo);        border:1px solid rgba(56,189,248,0.25); }
.badge-status-in_progress { background:rgba(245,158,11,0.12);  color:var(--status-in-progress); border:1px solid rgba(245,158,11,0.25); }
.badge-status-review      { background:rgba(167,139,250,0.12); color:var(--status-review);      border:1px solid rgba(167,139,250,0.25); }
.badge-status-done        { background:rgba(34,197,94,0.12);   color:var(--status-done);        border:1px solid rgba(34,197,94,0.25); }
.badge-status-cancelled   { background:rgba(239,68,68,0.12);   color:var(--status-cancelled);   border:1px solid rgba(239,68,68,0.25); }

/* ─── KANBAN BOARD ────────────────────────────────────────── */
.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
  align-items: stretch;
  /* Fixed height so columns can scroll internally regardless of data volume.
     The 220px offset accounts for app-header (64) + page-content padding (24)
     + page header/filters (~100) + a small safety margin. */
  height: calc(100vh - 220px);
  min-height: 420px;
}
.kanban-board::-webkit-scrollbar { height: 6px; }

.kanban-column {
  width: 280px;
  min-width: 280px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  /* Use explicit height + min-height:0 so that .kanban-col-body can
     properly engage overflow-y:auto when there are many cards. */
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.kanban-column-header {
  padding: 14px 16px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  flex-shrink: 0;
  cursor: grab;
  transition: background 0.12s, box-shadow 0.12s;
  user-select: none;
}
.kanban-column-header:hover {
  background: var(--bg-elevated);
}
.kanban-column-header:active {
  cursor: grabbing;
}
/* 4.18+: handle de drag (⋮⋮) sutil que aparece no hover */
.kanban-col-drag-handle {
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: -2px;
  opacity: 0.4;
  transition: opacity 0.12s;
  flex-shrink: 0;
  cursor: grab;
}
.kanban-column-header:hover .kanban-col-drag-handle {
  opacity: 1;
}
/* Estados durante drag de coluna */
.kanban-column-header.col-dragging {
  opacity: 0.5;
}
.kanban-column.col-dragging {
  opacity: 0.5;
  transform: scale(0.99);
}
.kanban-column-header.col-drag-target {
  background: rgba(212, 168, 67, 0.18);
  box-shadow: inset 0 0 0 2px var(--brand-gold);
}
.kanban-col-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.kanban-col-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}
.kanban-col-count {
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}
.kanban-col-body {
  /* flex: 1 1 0 + min-height:0 is the canonical fix for
     "overflow-y:auto inside a flex column" behaving correctly. */
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kanban-col-body::-webkit-scrollbar { width: 6px; }
.kanban-col-body::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 3px;
}
.kanban-col-body::-webkit-scrollbar-thumb:hover {
  background: var(--border-default);
}
.kanban-col-body.drag-over {
  background: rgba(212,168,67,0.05);
  border-radius: var(--radius-md);
}

.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: grab;
  transition: all var(--transition-fast);
  position: relative;
  overflow: visible;
  user-select: none;
}
.kanban-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--priority-medium);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.kanban-card.urgent::before { background: var(--priority-urgent); }
.kanban-card.high::before   { background: var(--priority-high); }
.kanban-card.medium::before { background: var(--priority-medium); }
.kanban-card.low::before    { background: var(--priority-low); }

/* Botão circular de conclusão rápida no canto do card kanban.
   Estado padrão: borda + ✓ cinzas. Hover: ambos verdes (preview).
   Checked: fundo verde + ✓ branco. Mesmo padrão visual da .task-check
   da lista — paridade UX entre #tasks e #kanban. */
.kanban-card-check:hover:not(.disabled):not(.checked) {
  border-color: var(--color-success) !important;
  color: var(--color-success) !important;
}

.kanban-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.kanban-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
  transform: rotate(2deg) scale(1.02);
  box-shadow: var(--shadow-xl);
}
.kanban-card-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
  /* 4.21+ — padding-left aumentado p/ não colidir com bulk-checkbox (top-left).
     Antes: 6px → checkbox sobrepunha o início do título e do projeto. */
  padding-left: 24px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  /* Exibe até 3 linhas; trunca com reticências se exceder */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.kanban-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 6px;
}
.kanban-card-project {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  /* 4.21+ — clearance pro bulk-checkbox (16px @ left:8px) */
  padding-left: 24px;
}
.kanban-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-left: 6px;
  margin-bottom: 8px;
}

/* 4.21+ — Bulk checkbox subtle por padrão, evidente só quando útil.
   - default: invisível (não polui o card limpo)
   - hover do card OU card já selecionado: aparece
   - quando algum card está selecionado, o card hovered também mostra
     pra facilitar adicionar/tirar da seleção */
.kanban-bulk-checkbox {
  opacity: 0;
  transition: opacity 0.15s ease;
}
.kanban-card:hover .kanban-bulk-checkbox,
.kanban-card.bulk-selected .kanban-bulk-checkbox,
.kanban-card:focus-within .kanban-bulk-checkbox {
  opacity: 1;
}
.kanban-tag {
  font-size: 0.625rem;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-weight: 500;
}
.kanban-card-due {
  font-size: 0.6875rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.kanban-card-due.overdue { color: var(--color-danger); }
.kanban-card-due.soon    { color: var(--color-warning); }

.kanban-add-btn {
  margin: 8px 10px;
  padding: 8px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-default);
  color: var(--text-muted);
  font-size: 0.8125rem;
  background: none;
  cursor: pointer;
  width: calc(100% - 20px);
  text-align: left;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.kanban-add-btn:hover {
  border-color: var(--brand-gold);
  color: var(--brand-gold);
  background: rgba(212,168,67,0.05);
}
/* 4.15+: variante posicionada no TOPO (logo abaixo do header da coluna).
 * Ajusta margens e visual sutilmente pra ficar mais discreto + acessível.
 */
.kanban-add-btn.kanban-add-btn-top {
  margin: 4px 10px 8px;
  padding: 6px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  text-align: center;
  border-style: dashed;
}
.kanban-add-btn.kanban-add-btn-top:hover {
  background: rgba(212,168,67,0.08);
  border-style: solid;
}

/* Drag placeholder */
.kanban-placeholder {
  height: 80px;
  border: 2px dashed var(--brand-gold);
  border-radius: var(--radius-md);
  background: rgba(212,168,67,0.05);
  opacity: 0.6;
}

/* ─── TASK DETAIL MODAL ───────────────────────────────────── */
.task-modal-grid {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 24px;
}
.task-modal-main {}
.task-modal-sidebar {
  border-left: 1px solid var(--border-subtle);
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.task-modal-title-input {
  width: 100%;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 600;
  font-family: var(--font-ui);
  padding: 4px 0 8px;
  outline: none;
  transition: border-color var(--transition-fast);
}
.task-modal-title-input:focus {
  border-bottom-color: var(--brand-gold);
}
.task-modal-title-input::placeholder { color: var(--text-muted); }

.task-detail-field {
  margin-bottom: 16px;
}
.task-detail-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.task-detail-value {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Subtasks */
.subtask-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.subtask-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background var(--transition-fast);
}
.subtask-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-subtle);
}
.subtask-item.done .subtask-label {
  text-decoration: line-through;
  color: var(--text-muted);
}
.subtask-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  flex: 1;
}
.subtask-progress {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.subtask-due {
  font-size: 0.6875rem;
  padding: 2px 6px;
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}
.subtask-due:hover { filter: brightness(1.15); }
.subtask-due.overdue { background: rgba(239,68,68,0.15); color: #F87171; }
.subtask-due.today   { background: rgba(251,191,36,0.15); color: #FBBF24; font-weight: 600; }
.subtask-due.soon    { background: rgba(96,165,250,0.15); color: #60A5FA; }
.subtask-add-due { opacity: 0; transition: opacity var(--transition-fast); }
.subtask-item:hover .subtask-add-due { opacity: 0.7; }
.subtask-add-due:hover { opacity: 1 !important; }

/* Drag handle */
.subtask-drag-handle {
  cursor: grab;
  color: var(--text-muted);
  font-size: 0.875rem;
  letter-spacing: -2px;
  opacity: 0;
  transition: opacity var(--transition-fast);
  user-select: none;
  padding: 0 2px;
  line-height: 1;
}
.subtask-item:hover .subtask-drag-handle { opacity: 0.6; }
.subtask-drag-handle:hover { opacity: 1 !important; }
.subtask-drag-handle:active { cursor: grabbing; }
.subtask-item.dragging {
  opacity: 0.45;
  background: var(--bg-elevated);
  border-color: var(--border-accent);
}

/* Label clicável p/ edição inline */
.subtask-label { cursor: text; }
.subtask-edit-input {
  flex: 1;
  font-size: 0.875rem;
  padding: 4px 6px;
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  background: var(--bg-input, var(--bg-elevated));
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
}

/* Botão remover subtarefa */
.subtask-delete-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
  opacity: 0;
  transition: opacity var(--transition-fast), color var(--transition-fast);
  border-radius: var(--radius-sm);
}
.subtask-item:hover .subtask-delete-btn { opacity: 0.6; }
.subtask-delete-btn:hover {
  opacity: 1 !important;
  color: var(--color-danger);
}

/* Comments */
.comment-list { display: flex; flex-direction: column; gap: 12px; }
.comment-item {
  display: flex;
  gap: 10px;
}
.comment-bubble {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}
.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.comment-author { font-size: 0.8125rem; font-weight: 600; color: var(--text-primary); }
.comment-time   { font-size: 0.75rem; color: var(--text-muted); }
.comment-text   { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.5; }

.comment-input-area {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  align-items: flex-end;
}
.comment-input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: var(--font-ui);
  resize: none;
  outline: none;
  min-height: 38px;
  max-height: 120px;
  transition: border-color var(--transition-fast);
}
.comment-input:focus { border-color: var(--brand-gold); }

/* ─── @MENTION TAG ─────────────────────────────────────────── */
.mention-tag {
  color: var(--brand-gold);
  font-weight: 600;
  background: rgba(212, 175, 55, 0.10);
  padding: 1px 4px;
  border-radius: 4px;
  cursor: default;
}

/* ─── CALENDAR VIEW ───────────────────────────────────────── */
.calendar-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}
.calendar-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}
.calendar-nav-btn {
  width: 38px; height: 38px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition-fast);
}
.calendar-nav-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.calendar-month-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 180px;
  text-align: center;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.calendar-day-label {
  padding: 10px 8px;
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}
.calendar-cell {
  min-height: 110px;
  padding: 8px 6px;
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-fast);
  position: relative;
}
.calendar-cell:hover { background: var(--bg-hover); }
.calendar-cell:nth-child(7n) { border-right: none; }
.calendar-cell.other-month { opacity: 0.35; }
.calendar-cell.today { background: rgba(212,168,67,0.06); }
.calendar-date-num {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.calendar-cell.today .calendar-date-num {
  background: var(--brand-gold);
  color: var(--text-inverse);
  font-weight: 700;
}
.calendar-task-pill {
  font-size: 0.6875rem;
  padding: 2px 6px;
  border-radius: 3px;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: filter var(--transition-fast);
}
.calendar-task-pill:hover { filter: brightness(1.2); }
.calendar-more {
  font-size: 0.6875rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 1px 4px;
}
.calendar-more:hover { color: var(--brand-gold); }

/* ─── TIMELINE / GANTT ────────────────────────────────────── */
.timeline-wrapper {
  overflow: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}
.timeline-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-width: 800px;
}
.timeline-tasks-col {
  border-right: 1px solid var(--border-default);
  background: var(--bg-surface);
  position: sticky;
  left: 0;
  z-index: 2;
}
.timeline-header-row {
  display: contents;
}
.timeline-header-left {
  padding: 12px 16px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-default);
  background: var(--bg-surface);
  position: sticky;
  top: 0;
  z-index: 3;
}
.timeline-header-dates {
  border-bottom: 1px solid var(--border-default);
  display: flex;
  background: var(--bg-surface);
  position: sticky;
  top: 0;
  z-index: 2;
}
.timeline-date-cell {
  min-width: 40px;
  flex: 1;
  padding: 12px 4px;
  text-align: center;
  font-size: 0.6875rem;
  color: var(--text-muted);
  border-right: 1px solid var(--border-subtle);
}
.timeline-date-cell.today-col {
  color: var(--brand-gold);
  font-weight: 600;
}
.timeline-row {
  display: contents;
}
.timeline-task-info {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
}
.timeline-task-name {
  font-size: 0.8125rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.timeline-bars-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  display: flex;
  align-items: center;
}
.timeline-bar {
  position: absolute;
  height: 26px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 0.6875rem;
  font-weight: 500;
  color: white;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: filter var(--transition-fast);
  z-index: 1;
}
.timeline-bar:hover { filter: brightness(1.15); }
.timeline-today-line {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--brand-gold);
  opacity: 0.6;
  z-index: 1;
}

/* ─── Subtask touchpoints na timeline ─────────────────────── */
.timeline-subtask-dot {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-card);
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  z-index: 3;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.timeline-subtask-dot:hover {
  transform: translate(-50%, -50%) scale(1.35);
  box-shadow: 0 0 0 2px var(--brand-gold), 0 2px 6px rgba(0, 0, 0, 0.5);
}
.timeline-subtask-dot.done {
  background: #22c55e;
  border-color: rgba(255, 255, 255, 0.95);
}
.timeline-subtask-dot.dated {
  border-style: solid;
}
.timeline-subtask-dot.auto {
  border-style: dashed;
  opacity: 0.85;
}

.tl-subtask-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.6875rem;
  color: var(--text-muted);
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
  flex-shrink: 0;
}

.tl-flash {
  animation: tl-flash-anim 1.2s ease;
}
@keyframes tl-flash-anim {
  0%, 100% { box-shadow: none; }
  30%      { box-shadow: 0 0 0 2px var(--brand-gold), 0 0 14px rgba(212, 168, 67, 0.5); }
}

/* ─── PROJECT CARDS ───────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.project-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.project-card-banner {
  height: 6px;
}
.project-card-body { padding: 16px; }
.project-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}
.project-card-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.project-card-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.project-card-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.project-card-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
}
.project-card-stat {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.project-card-stat strong {
  color: var(--text-primary);
  font-size: 0.875rem;
}
.project-card-progress { margin-bottom: 12px; }
.project-card-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.project-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

/* ─── QUICK ADD TASK BAR ──────────────────────────────────── */
.quick-add-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--bg-surface);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-md);
  cursor: text;
  transition: all var(--transition-fast);
  margin-bottom: 4px;
}
.quick-add-bar:focus-within {
  border-color: var(--brand-gold);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 3px rgba(212,168,67,0.08);
}
.quick-add-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: var(--font-ui);
  outline: none;
}
.quick-add-input::placeholder { color: var(--text-muted); }

/* ─── ASSIGNEE MULTI-SELECT ──────────────────────────────── */
.assignee-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.assignee-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.assignee-chip:hover {
  border-color: var(--color-danger);
  color: var(--color-danger);
}
.assignee-chip .avatar { width: 20px; height: 20px; font-size: 0.5rem; }

.assignee-add-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px dashed var(--border-default);
  background: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition-fast);
}
.assignee-add-btn:hover {
  border-color: var(--brand-gold);
  color: var(--brand-gold);
}

/* ─── TAG INPUT ───────────────────────────────────────────── */
.tag-input-area {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: text;
  min-height: 40px;
  transition: border-color var(--transition-fast);
}
.tag-input-area:focus-within { border-color: var(--brand-gold); }
.tag-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px 2px 6px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
}
.tag-chip-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  font-size: 0.7rem;
  padding: 0;
  line-height: 1;
}
.tag-chip-remove:hover { opacity: 1; }
.tag-input-field {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-family: var(--font-ui);
  outline: none;
  min-width: 80px;
  flex: 1;
}

/* ─── EMPTY STATES ────────────────────────────────────────── */
.task-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}
.task-empty-icon { font-size: 3rem; opacity: 0.3; margin-bottom: 12px; }
.task-empty-title { font-size: 1.0625rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }

/* ─── SECTION GROUPS ──────────────────────────────────────── */
.task-group { margin-bottom: 24px; }
.task-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  margin-bottom: 6px;
  cursor: pointer;
}
.task-group-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.task-group-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  padding: 1px 7px;
}
.task-group-chevron {
  color: var(--text-muted);
  font-size: 0.75rem;
  transition: transform var(--transition-fast);
}
.task-group.collapsed .task-group-chevron { transform: rotate(-90deg); }
.task-group.collapsed .task-group-body    { display: none; }

/* ─── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .task-row { grid-template-columns: 28px 28px 1fr 110px 110px; }
  .task-row > *:nth-child(n+7) { display: none; }
  .task-list-header > *:nth-child(n+7) { display: none; }
  .task-modal-grid { grid-template-columns: 1fr; }
  .task-modal-sidebar { border-left: none; padding-left: 0; border-top: 1px solid var(--border-subtle); padding-top: 16px; }
}
@media (max-width: 640px) {
  .task-row { grid-template-columns: 28px 28px 1fr 80px; }
  .task-row > *:nth-child(n+4) { display: none; }
  .task-list-header > *:nth-child(n+4) { display: none; }
  .projects-grid { grid-template-columns: 1fr; }
}

/* Calendar drag and drop */
[data-date].cal-drag-over {
  background: rgba(212,168,67,0.12) !important;
  outline: 2px dashed var(--brand-gold);
  outline-offset: -2px;
}
.cal-task-pill[draggable="true"] { cursor: grab; }
.cal-task-pill[draggable="true"]:active { cursor: grabbing; }
