/* =========================================================================
   Todo quick-add — project picker
   ========================================================================= */
.todo-qa-project { position: relative; flex-shrink: 0; }

.todo-qa-project-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer; font-family: inherit;
  font-size: 12.5px;
  color: var(--text-lo);
  transition: all 120ms;
  max-width: 180px;
}
.todo-qa-project-btn:hover {
  color: var(--text-hi);
  border-color: rgba(var(--primary-rgb, 127,13,242), 0.35);
}
.todo-qa-project-btn.has-value {
  color: var(--color-primary);
  background: rgba(var(--primary-rgb, 127,13,242), 0.08);
  border-color: rgba(var(--primary-rgb, 127,13,242), 0.3);
}
.todo-qa-project-btn > span {
  max-width: 110px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.todo-qa-project-btn .material-symbols-outlined { font-size: 15px; }
.todo-qa-project-btn .trail { font-size: 16px; opacity: 0.6; }

.todo-qa-project-menu {
  position: absolute;
  top: calc(100% + 6px); right: 0;
  min-width: 220px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.4),
              0 0 0 1px rgba(var(--primary-rgb, 127,13,242), 0.12);
  z-index: 50;
  display: flex; flex-direction: column; gap: 2px;
}

.todo-qa-project-head {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 8px 10px 6px;
}

.todo-qa-project-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  background: transparent; border: 0;
  border-radius: 7px;
  cursor: pointer; font-family: inherit;
  font-size: 13px;
  color: var(--text-md);
  text-align: left; width: 100%;
  transition: background 120ms;
}
.todo-qa-project-item:hover {
  background: rgba(var(--primary-rgb, 127,13,242), 0.08);
  color: var(--text-hi);
}
.todo-qa-project-item.is-active {
  color: var(--color-primary);
  background: rgba(var(--primary-rgb, 127,13,242), 0.08);
}
.todo-qa-project-item.is-new {
  color: var(--color-primary);
  font-weight: 600;
}
.todo-qa-project-item > .material-symbols-outlined { font-size: 16px; color: var(--text-muted); }
.todo-qa-project-item.is-active > .material-symbols-outlined,
.todo-qa-project-item.is-new > .material-symbols-outlined { color: var(--color-primary); }
.todo-qa-project-item > span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.todo-qa-project-item .trail { color: var(--color-primary) !important; font-size: 14px; }

.todo-qa-project-divider {
  height: 1px;
  background: var(--color-border);
  margin: 4px 6px;
}

/* =========================================================================
   Per-tool settings — Todo fields config (in Settings → Tools detail)
   ========================================================================= */
.todo-fields-cfg {
  display: flex; flex-direction: column; gap: 12px;
}
.todo-fields-cfg-head {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 4px 4px 6px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 4px;
}
.todo-fields-cfg-head > .material-symbols-outlined {
  font-size: 18px; color: var(--color-primary);
  margin-top: 2px;
  font-variation-settings: "FILL" 1, "wght" 500;
}
.todo-fields-cfg-head > div { flex: 1; }
.todo-fields-cfg-head .title {
  font-size: 12px; font-weight: 700; color: var(--text-hi);
}
.todo-fields-cfg-head .sub {
  font-size: 11px; color: var(--text-muted);
  margin-top: 2px; line-height: 1.5;
}
.todo-fields-cfg-count {
  font-size: 11px; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.todo-fields-cfg-count strong { color: var(--color-primary); font-weight: 700; }

.todo-fields-cfg-list {
  display: flex; flex-direction: column;
  gap: 4px;
}
.todo-field-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer; font-family: inherit;
  text-align: left;
  transition: all 120ms;
}
.todo-field-row:hover { border-color: rgba(var(--primary-rgb, 127,13,242), 0.35); }
.todo-field-row.is-on {
  background: rgba(var(--primary-rgb, 127,13,242), 0.04);
  border-color: rgba(var(--primary-rgb, 127,13,242), 0.25);
}
.todo-field-icon {
  width: 26px; height: 26px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--text-lo);
  flex-shrink: 0;
}
.todo-field-row.is-on .todo-field-icon {
  background: rgba(var(--primary-rgb, 127,13,242), 0.1);
  border-color: rgba(var(--primary-rgb, 127,13,242), 0.3);
  color: var(--color-primary);
}
.todo-field-icon .material-symbols-outlined { font-size: 14px; }
.todo-field-body { flex: 1; min-width: 0; }
.todo-field-label { font-size: 12.5px; font-weight: 600; color: var(--text-hi); }
.todo-field-desc { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

.todo-field-toggle {
  width: 30px; height: 17px;
  border-radius: 999px;
  background: var(--color-border);
  position: relative; flex-shrink: 0;
  transition: background 150ms;
}
.todo-field-toggle.is-on { background: var(--color-primary); }
.todo-field-toggle-dot {
  position: absolute; top: 2px; left: 2px;
  width: 13px; height: 13px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transition: transform 150ms;
}
.todo-field-toggle.is-on .todo-field-toggle-dot { transform: translateX(13px); }

/* =========================================================================
   View switcher (List / Kanban)
   ========================================================================= */
.todo-view-pick {
  display: inline-flex;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px; padding: 2px;
  flex-shrink: 0;
}
.todo-view-btn {
  width: 28px; height: 26px;
  border: 0; background: transparent;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-lo); cursor: pointer;
}
.todo-view-btn:hover { color: var(--text-hi); }
.todo-view-btn.is-active { background: var(--color-primary); color: #fff; }
.todo-view-btn .material-symbols-outlined { font-size: 16px; }

/* =========================================================================
   Kanban columns settings (in tool settings)
   ========================================================================= */
.todo-cols-cfg { display: flex; flex-direction: column; gap: 6px; }
.todo-col-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px; align-items: center;
  padding: 10px 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
}
.todo-col-color-wrap { position: relative; }
.todo-col-color {
  display: block;
  width: 24px; height: 24px;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 3px currentColor;
}
.todo-col-color-wrap:hover .todo-col-palette { display: flex; }
.todo-col-palette {
  display: none;
  position: absolute; top: calc(100% + 6px); left: 0;
  z-index: 20;
  padding: 6px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  gap: 4px;
}
.todo-col-swatch {
  width: 20px; height: 20px;
  border-radius: 5px;
  border: 0; cursor: pointer;
  transition: transform 100ms;
}
.todo-col-swatch:hover { transform: scale(1.15); }
.todo-col-swatch.is-active {
  box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 3px currentColor;
}

.todo-col-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.todo-col-title-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 0; cursor: pointer;
  padding: 0;
  font-family: inherit;
  font-size: 13px; font-weight: 600;
  color: var(--text-hi);
  text-align: left;
}
.todo-col-title-btn:hover { color: var(--color-primary); }
.todo-col-title-btn .material-symbols-outlined { font-size: 13px; color: var(--text-muted); }
.todo-col-done-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-lo);
  cursor: pointer;
}
.todo-col-done-toggle input { width: 13px; height: 13px; accent-color: var(--color-primary); }

.todo-col-actions { display: flex; gap: 2px; }

/* =========================================================================
   Kanban view
   ========================================================================= */
.todo-kanban-wrap {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  position: relative;
}

.todo-kanban-search {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 24px;
  border-bottom: 1px solid var(--color-border);
  font-size: 12px;
}
.todo-kanban-search > .material-symbols-outlined { font-size: 16px; color: var(--text-muted); }
.todo-kanban-search input {
  flex: 1; background: transparent; border: 0; outline: none;
  font-family: inherit; font-size: 13px; color: var(--text-hi);
}
.todo-kanban-search input::placeholder { color: var(--text-faint); }

.todo-kanban {
  flex: 1; overflow-x: auto; overflow-y: hidden;
  display: flex; gap: 14px;
  padding: 18px 24px;
  align-items: stretch;
  min-height: 0;
}

.kanban-col {
  flex: 0 0 280px;
  display: flex; flex-direction: column;
  background: rgba(0,0,0,0.08);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  min-height: 0;
  transition: background 120ms, border-color 120ms;
}
html.light .kanban-col { background: rgba(0,0,0,0.025); }
.kanban-col.is-drop-target {
  background: rgba(var(--primary-rgb, 127,13,242), 0.06);
  border-color: rgba(var(--primary-rgb, 127,13,242), 0.4);
}

.kanban-col-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
}
.kanban-col-dot {
  width: 10px; height: 10px; border-radius: 999px;
  flex-shrink: 0;
}
.kanban-col-title {
  font-weight: 600; color: var(--text-hi);
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kanban-col-count {
  font-size: 11px; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  background: rgba(255,255,255,0.05);
  padding: 1px 7px; border-radius: 999px;
}
html.light .kanban-col-count { background: rgba(0,0,0,0.05); }
.kanban-col-done-flag {
  font-size: 14px; color: var(--color-success);
}

.kanban-col-body {
  flex: 1; overflow-y: auto;
  padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
}
.kanban-col-empty {
  padding: 18px 8px; text-align: center;
  color: var(--text-muted);
  font-size: 11.5px;
  border: 1px dashed var(--color-border);
  border-radius: 8px;
}

.kanban-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 9px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 120ms, transform 120ms, box-shadow 120ms;
  position: relative;
}
.kanban-card:hover {
  border-color: rgba(var(--primary-rgb, 127,13,242), 0.4);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.18);
}
.kanban-card.is-selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary);
}
.kanban-card.is-done .kanban-card-title { text-decoration: line-through; color: var(--text-muted); }

.kanban-card-prio {
  position: absolute; top: 8px; right: 8px;
  font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 1px 6px; border-radius: 4px;
}
.kanban-card-prio.prio-high { background: rgba(248,113,113,0.15); color: #fca5a5; }
.kanban-card-prio.prio-med  { background: rgba(251,191,36,0.15); color: #fcd34d; }
.kanban-card-prio.prio-low  { background: rgba(96,165,250,0.15); color: #93c5fd; }

.kanban-card-title {
  font-size: 13px; font-weight: 500;
  color: var(--text-hi);
  line-height: 1.4;
  padding-right: 38px;
  word-break: break-word;
}

.kanban-card-meta {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 8px;
  font-size: 11px;
}
.kanban-card-due { display: inline-flex; align-items: center; gap: 3px; color: var(--text-lo); }
.kanban-card-due.is-overdue { color: var(--color-error); }
.kanban-card-due .material-symbols-outlined { font-size: 12px; }
.kanban-card-subs { display: inline-flex; align-items: center; gap: 3px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.kanban-card-subs .material-symbols-outlined { font-size: 12px; }
.kanban-card-proj {
  font-size: 10px; color: var(--text-muted);
  padding: 1px 6px;
  background: rgba(255,255,255,0.04);
  border-radius: 4px;
}
html.light .kanban-card-proj { background: rgba(0,0,0,0.04); }
.kanban-card-link { display: inline-flex; align-items: center; gap: 2px; color: var(--color-primary); }
.kanban-card-link .material-symbols-outlined { font-size: 12px; }
.kanban-card-tags {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-top: 6px;
}
.kanban-card-tag {
  font-size: 10px; color: #c4a0ff;
}

/* Drawer for task detail when in kanban view */
.todo-drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex; justify-content: flex-end;
  animation: lh-dialog-fade 150ms ease-out;
}
.todo-drawer {
  width: min(520px, 100%);
  height: 100%;
  background: var(--color-bg);
  border-left: 1px solid var(--color-border);
  box-shadow: -16px 0 40px rgba(0,0,0,0.4);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: todo-drawer-in 180ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes todo-drawer-in {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
