/* ===== Tasks page + topbar quick-access popover ===== */

.tsk-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .tsk-split { grid-template-columns: 1fr; } }

.tsk-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.tsk-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; }

.tsk-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tsk-date-heading { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--ink); min-width: 220px; }

.tsk-search-wrap { position: relative; flex: 1; min-width: 160px; }
.tsk-search-wrap .drv-input { width: 100%; }
.tsk-search-results {
  position: absolute; z-index: 30; top: 40px; left: 0; right: 0; max-height: 260px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  box-shadow: var(--shadow-popover); padding: 6px;
}
.tsk-search-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 9px; border-radius: 8px; font-size: 13px; color: var(--ink); cursor: pointer; }
.tsk-search-row:hover { background: var(--hover); }
.tsk-search-date { font-size: 11.5px; color: var(--ink-4); flex: none; }

.tsk-overdue { border-top: 3px solid #d99a2b; padding: 10px 14px; display: flex; flex-direction: column; }
.tsk-overdue-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 4px 2px 6px; font-family: var(--font-display); font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; color: #b5791c; }
.tsk-overdue-count { font-family: var(--font-body); font-size: 11.5px; font-weight: 500; letter-spacing: 0; color: var(--ink-4); text-transform: none; }

.tsk-list { padding: 4px 14px; }

.tsk-row { display: flex; align-items: flex-start; gap: 10px; padding: 12px 2px; border-top: 1px solid var(--line-soft); border-radius: 8px; }
.tsk-row:first-child { border-top: none; }
.tsk-row--done .tsk-row__title span:first-child { text-decoration: line-through; color: var(--ink-4); }
.tsk-row--selected { background: var(--hover); }
.tsk-check { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--blue-500); cursor: pointer; flex: none; }
.tsk-drag-handle { display: flex; align-items: center; justify-content: center; width: 14px; margin-top: 3px; flex: none; color: var(--ink-4); cursor: grab; opacity: 0; transition: opacity var(--dur-fast) var(--ease-out); }
.tsk-row:hover .tsk-drag-handle, .tsk-row:focus-within .tsk-drag-handle { opacity: 1; }
.tsk-drag-handle:active { cursor: grabbing; }
.tsk-row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; cursor: pointer; }
.tsk-row__title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; color: var(--ink); }
.tsk-row__note { font-size: 12px; color: var(--ink-3); }
.tsk-tag { display: inline-flex; align-items: center; height: 19px; padding: 0 8px; border-radius: 999px; background: var(--chip-on); color: var(--chip-on-fg); font-size: 10.5px; font-weight: 700; }
.tsk-tag--overdue { background: #fdf2f1; color: #b5321f; }
.tsk-repeat-icon { color: var(--ink-4); flex: none; }

.tsk-row__actions { display: flex; align-items: center; gap: 4px; flex: none; opacity: 0; transition: opacity var(--dur-fast) var(--ease-out); }
.tsk-row:hover .tsk-row__actions, .tsk-row:focus-within .tsk-row__actions { opacity: 1; }
.tsk-icon-btn { width: 26px; height: 26px; }
.tsk-pill-btn {
  display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); font-size: 11.5px; font-weight: 600; color: var(--ink-2); cursor: pointer;
}
.tsk-pill-btn:hover { background: var(--hover); }

.tsk-time-row { display: flex; gap: 10px; }
.tsk-time-row .drv-field { flex: 1; }

/* ---- Analytics (today / this week donuts) ---- */
.tsk-analytics { padding: 16px 14px; }
.tsk-analytics-row { display: flex; align-items: flex-start; justify-content: space-around; gap: 10px; }
.tsk-stat { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tsk-donut { display: block; }
.tsk-donut__text { font-family: var(--font-display); font-size: 19px; font-weight: 800; fill: var(--ink); }
.tsk-stat-label { font-family: var(--font-display); font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-top: 2px; }
.tsk-stat-sub { font-size: 11.5px; color: var(--ink-4); }
.tsk-week-nav { display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.tsk-week-nav .icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.tsk-week-nav .icon-btn:disabled:hover { background: none; }
.tsk-week-range { font-size: 11px; color: var(--ink-3); min-width: 68px; text-align: center; }

/* ---- Detail panel ---- */
.tsk-detail { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 13px; min-height: 120px; }
.tsk-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 11px; border-bottom: 1px solid var(--line-soft); }
.tsk-detail-title { font-family: var(--font-display); font-size: 14px; font-weight: 700; color: var(--ink); }
.tsk-detail-goal { display: flex; gap: 10px; }
.tsk-detail-goal .drv-field { flex: 1; }

/* ---- Topbar "Today's Tasks" popover ---- */
.tasks-popover-row { align-items: center; cursor: pointer; }
.tasks-popover-check { width: 15px; height: 15px; accent-color: var(--blue-500); cursor: pointer; flex: none; }
.tasks-popover-row__text--done { text-decoration: line-through; color: var(--ink-4); }
.tasks-popover-quickadd { padding: 8px 6px 4px; border-top: 1px solid var(--line-soft); margin-top: 4px; }
.tasks-popover-quickadd input {
  width: 100%; height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface-2); font-size: 12.5px; color: var(--ink);
}
.tasks-popover-quickadd input:focus { outline: none; border-color: var(--blue-500); }
