/* ---------- To-do ---------- */
.todo-form {
  display: flex;
  gap: 7px;
  padding: 0 14px 12px;
  flex-shrink: 0;
}

.todo-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* Each to-do is a soft card — subtle surface + hairline + small shadow,
   kept close together (small list gap) so they read as one tidy stack. */
.todo-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: background var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.todo-item:hover {
  background: var(--surface-2);
  box-shadow: var(--shadow-md);
}

.todo-check {
  flex-shrink: 0;
  width: 19px;
  height: 19px;
  border-radius: 6px;
  border: 1.5px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-fg);
  font-size: 11px;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.todo-check:hover {
  border-color: var(--accent);
}

.todo-item.done .todo-check {
  background: var(--accent);
  border-color: var(--accent);
}

/* text + due badge stack vertically inside the card */
.todo-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.todo-text {
  min-width: 0;
  word-break: break-word;
  line-height: 1.35;
  font-size: 12px;
}

.todo-item.done .todo-text {
  text-decoration: line-through;
  color: var(--faint);
}

.todo-del {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: var(--r-sm);
  color: var(--faint);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.todo-item:hover .todo-del {
  opacity: 1;
}

.todo-del:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.todo-edit {
  flex: 1;
  height: 26px;
  padding: 0 6px;
  border: 1px solid var(--accent);
  border-radius: var(--r-sm);
  background: var(--bg);
}

.todo-edit:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.todo-empty {
  color: var(--faint);
  font-size: var(--fs-sm);
  padding: 10px;
  text-align: center;
}

.todo-foot {
  padding: 8px 14px 12px;
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
}

/* ---------- Due date / urgency ---------- */
/* "due in 3 days" line under the task title */
.todo-due {
  font-size: var(--fs-xs);
  color: var(--muted);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

/* Cards with a due time get a soft urgency tint (set per-card in JS via
   --due-bg: green → yellow → red as the due time approaches). */
.todo-item.has-due {
  background: var(--due-bg, var(--surface));
  border-color: color-mix(in oklch, var(--due-bg, var(--border)), #000 14%);
}

.todo-item.has-due:hover {
  background: var(--due-bg, var(--surface-2));
  box-shadow: var(--shadow-md);
}

.todo-item.has-due .todo-due {
  color: color-mix(in oklch, var(--ink), transparent 12%);
}

.todo-item.overdue {
  border-color: var(--danger);
}

.todo-item.overdue .todo-due {
  color: var(--danger);
  font-weight: 600;
}

/* Set due date+time modal */
.due-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.due-remove {
  margin-right: auto;
}

