/* ============================================================
   TO-DOS v2 (2026-10-15): dashboard-style band (title, search, actions, stat chips),
   then [list card | rail]. Scoped to .td-page; the row / detail / form classes keep
   their names (todo-*) and their base styles in components.css. This file only
   restyles them inside the page.
   ============================================================ */
.td-page {
  --t-ink: #0B1F17; --t-ink-2: #2F3B36; --t-muted: #61706A; --t-faint: #98A39E;
  --t-line: #E4E9E6; --t-line-2: #EEF1EF; --t-soft: #F1F4F2; --t-em: #047857; --t-em-2: #059669;
  --t-radius: 16px; --t-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 32px -22px rgba(16, 24, 40, .28);
  position: relative; color: var(--t-ink);
}
.td-page svg.lucide { width: 15px; height: 15px; flex: 0 0 auto; }
.td-page [hidden] { display: none !important; }
.td-page .sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ── Band ── */
.td-page .td-hero {
  --gl: max(var(--page-gutter, 24px), env(safe-area-inset-left, 0px));
  --gr: max(var(--page-gutter, 24px), env(safe-area-inset-right, 0px));
  position: relative; isolation: isolate; overflow: hidden; min-width: 0;
  margin: calc(-1 * var(--page-gutter, 24px)) calc(-1 * var(--gr)) 0 calc(-1 * var(--gl));
  padding: 16px var(--gr) 60px var(--gl);
  border-bottom: 1px solid #D3E7DB;
  background:
    radial-gradient(520px 220px at 0% 0%, rgba(11, 143, 90, .17), transparent 68%),
    radial-gradient(420px 200px at 60% -20%, rgba(59, 130, 246, .10), transparent 70%),
    radial-gradient(520px 260px at 95% 0%, rgba(245, 158, 11, .12), transparent 66%),
    linear-gradient(112deg, #E3F3EA 0%, #EEF8F2 50%, #FBF6EC 100%);
}
.td-page .td-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(11, 143, 90, .16) 1px, transparent 1.3px); background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 92%); mask-image: linear-gradient(180deg, #000 0%, transparent 92%); opacity: .55;
}
.td-page .td-hero > *, .td-page > .td-layout { width: 100%; max-width: 1480px; margin-left: auto; margin-right: auto; }
.td-page > .td-layout { position: relative; z-index: 1; margin-top: -44px; }
.td-page .td-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 24px; margin-bottom: 12px; }
.td-page .td-intro { min-width: 0; }
.td-page .td-head h1 { margin: 0; font-size: 30px; letter-spacing: -.025em; line-height: 1.1; }
.td-page .td-head p { margin: 3px 0 0; color: var(--t-muted); font-size: 13.5px; }
.td-page .td-acts { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.td-page .td-acts .btn { display: inline-flex; align-items: center; gap: 6px; height: 38px; min-height: 0; }
.td-page .td-search { position: relative; display: flex; align-items: center; }
.td-page .td-search svg { position: absolute; z-index: 1; left: 11px; color: var(--t-faint); pointer-events: none; }
.td-page .td-search input.todo-search-inline { width: 260px; height: 38px; min-height: 0; flex: none; padding: 0 12px 0 34px; border: 1px solid rgba(15, 23, 42, .1); border-radius: 10px; background: rgba(255, 255, 255, .85); font: inherit; font-size: 13px; }
.td-page .td-search input.todo-search-inline:focus { outline: none; border-color: var(--t-em-2); box-shadow: 0 0 0 3px rgba(5, 150, 105, .14); background: #fff; }
.td-page .td-stats { display: flex; flex-wrap: wrap; gap: 8px; min-height: 34px; }
.td-page .td-stat { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px 0 5px; border: 1px solid rgba(15, 23, 42, .07); border-radius: 999px; background: rgba(255, 255, 255, .8); color: var(--t-muted); font: inherit; font-size: 12.5px; font-weight: 600; white-space: nowrap; cursor: pointer; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.td-page .td-stat:hover { background: #fff; color: var(--t-ink); border-color: #C9DED4; }
.td-page .td-stat b { color: var(--t-ink); font-size: 14.5px; font-weight: 750; font-variant-numeric: tabular-nums; }
.td-page .td-stat-ic { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--t-soft); color: var(--t-ink-2); }
.td-page .td-stat-ic svg { width: 13px; height: 13px; }
.td-page .td-stat.is-rose .td-stat-ic { background: #FFE4E8; color: #BE123C; }
.td-page .td-stat.is-amber .td-stat-ic { background: #FFEDD5; color: #C2410C; }
.td-page .td-stat.is-blue .td-stat-ic { background: #DBEAFE; color: #1D4ED8; }
.td-page .td-stat.is-violet .td-stat-ic { background: #EDE9FE; color: #6D28D9; }
.td-page .td-stat.is-green .td-stat-ic { background: #D1FAE5; color: #047857; }

/* ── Layout ── */
.td-page .td-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.td-page .td-main { min-width: 0; border: 1px solid var(--t-line); border-radius: var(--t-radius); background: #fff; box-shadow: var(--t-shadow); }
.td-page .td-rail { display: flex; flex-direction: column; gap: 14px; min-width: 0; position: sticky; top: calc(var(--header-height, 56px) + 16px); }

/* toolbar: tabs + grouping */
.td-page .td-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 12px; border-bottom: 1px solid var(--t-line-2); }
.td-page .td-tabs { display: inline-flex; gap: 2px; max-width: 100%; min-width: 0; margin: 0; padding: 3px; overflow-x: auto; border: 0; border-radius: 11px; background: var(--t-soft); scrollbar-width: none; }
.td-page .td-tabs::-webkit-scrollbar { display: none; }
.td-page .td-tabs .tab { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; height: 30px; margin: 0; padding: 0 12px; border: 0; border-radius: 8px; background: none; color: var(--t-muted); font: inherit; font-size: 12.5px; font-weight: 650; white-space: nowrap; cursor: pointer; }
.td-page .td-tabs .tab::after { display: none; }
.td-page .td-tabs .tab:hover { color: var(--t-ink); }
.td-page .td-tabs .tab.active { background: #fff; color: var(--t-ink); box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }
.td-page .td-tabs em { padding: 0 6px; border-radius: 999px; background: #E2E8F0; color: #475569; font-size: 10.5px; font-style: normal; font-weight: 750; font-variant-numeric: tabular-nums; }
.td-page .td-tabs em:empty { display: none; }
.td-page .td-tabs .tab.active em { background: #D1FAE5; color: #047857; }
.td-page .td-seg { display: inline-flex; gap: 2px; margin-left: auto; padding: 3px; border-radius: 9px; background: var(--t-soft); }
.td-page .td-seg button { height: 26px; padding: 0 10px; border: 0; border-radius: 7px; background: none; color: var(--t-muted); font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; }
.td-page .td-seg button.is-on { background: #fff; color: var(--t-ink); box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }

/* filters */
.td-page .todo-filter-bar.td-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--t-line-2); border-radius: 0; background: #FCFDFC; }
.td-page .td-chips { display: inline-flex; gap: 2px; padding: 3px; border-radius: 9px; background: var(--t-soft); }
.td-page .td-chips button { height: 26px; padding: 0 10px; border: 0; border-radius: 7px; background: none; color: var(--t-muted); font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; }
.td-page .td-chips button.is-on { background: #fff; color: var(--t-ink); box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }
.td-page .td-pick { position: relative; display: inline-flex; align-items: center; margin: 0; }
.td-page .td-pick svg { position: absolute; left: 10px; z-index: 1; color: var(--t-muted); pointer-events: none; width: 13px; height: 13px; }
.td-page .todo-filter-bar .td-pick select { flex: none; width: auto !important; max-width: 170px; height: 30px; min-height: 0; padding: 0 26px 0 30px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 1px solid #E1E6E3; border-radius: 999px; background-color: #fff; color: var(--t-ink-2); font: inherit; font-size: 12.5px; font-weight: 600; }
.td-page .td-pick.is-on select { border-color: #34D399; background-color: #ECFDF5; color: var(--t-em); }
.td-page .todo-filter-bar .td-clear { height: 30px; min-height: 0; padding: 0 10px; font-size: 12px; }
.td-page .td-count { margin: 0 0 0 auto; color: var(--t-faint); font-size: 12px; font-weight: 600; white-space: nowrap; }
.td-page .todo-custom-date-row.td-range { margin: 0; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--t-line-2); border-radius: 0; background: #F7FAF8; }

/* list */
.td-page .td-list { gap: 0; padding: 2px 12px 14px; border-radius: 0 0 var(--t-radius) var(--t-radius); background: linear-gradient(180deg, #F7FAF8, #F3F6F4); }
.td-page .todo-section-card { margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.td-page .todo-section-header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 12px 2px 4px; padding: 0; border: 0; }
.td-page .todo-section-title { display: flex; align-items: center; gap: 8px; }
.td-page .todo-section-title h2 { margin: 0; color: var(--t-ink-2); font-size: 13px; font-weight: 750; letter-spacing: .02em; text-transform: uppercase; }
.td-page .todo-section-title .badge { min-width: 0; padding: 0 7px; border-radius: 999px; background: #E2E8F0; color: #475569; font-size: 10.5px; font-weight: 750; }
.td-page .todo-section-stats { color: var(--t-faint); font-size: 12px; font-weight: 600; }
.td-page .todo-section-scroll { max-height: none; overflow: visible; }
.td-page .todo-time-group { padding: 0; }
.td-page .todo-time-divider { margin: 10px 2px 6px; padding: 0; }
.td-page .todo-time-divider::after { border-bottom-color: #DCE3DF; }
.td-page .todo-time-label { color: var(--t-ink-2); font-size: 11.5px; font-weight: 750; letter-spacing: .04em; }
.td-page .todo-time-count { padding: 0 6px; background: #E2E8F0; color: #475569; font-size: 10.5px; font-weight: 750; }
.td-page .todo-time-group:first-of-type .todo-time-label { color: inherit; }
.td-page .todo-time-items { display: grid; gap: 6px; padding: 0; }
.td-page .todo-section-scroll { display: grid; gap: 6px; }

/* rows: cards with a priority edge; urgent and overdue rows get a soft tint */
.td-page .todo-row { position: relative; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border: 1px solid var(--t-line); border-left: 1px solid var(--t-line); border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.td-page .todo-row:last-child { border-bottom: 1px solid var(--t-line); }
.td-page .todo-row::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: #94A3B8; }
.td-page .todo-row.priority-urgent::before { background: #E11D48; }
.td-page .todo-row.priority-low::before { background: #CBD5E1; }
.td-page .todo-row:hover { transform: none; border-color: #CBD8D1; box-shadow: 0 10px 24px -20px rgba(4, 47, 36, .5); }
.td-page .todo-row.priority-urgent { border-color: #FBD5DC; background: linear-gradient(100deg, #FFF1F3 0%, #FFF8F9 40%, #fff 75%); }
.td-page .todo-row.overdue { border-color: #FBD5DC; background: linear-gradient(100deg, #FFF4F5 0%, #fff 60%); }
.td-page .todo-row.overdue::before { background: #E11D48; }
.td-page .todo-row.priority-low { background: #FBFCFC; }
.td-page .todo-row.done { opacity: 1; background: #FAFBFB; }
.td-page .todo-row.done::before { background: #10B981; }
.td-page .todo-row.done .todo-row-title { color: #94A3B8; text-decoration: line-through; text-decoration-color: rgba(148, 163, 184, .6); }
.td-page .todo-open { align-items: center; }
.td-page .todo-row-content { gap: 4px; }
.td-page .todo-row-title { font-size: 14px; font-weight: 650; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.td-page .todo-row-bottom { flex-wrap: wrap; gap: 4px 12px; color: var(--t-muted); font-size: 12px; }
.td-page .todo-row-assignee .avatar { width: 18px; height: 18px; font-size: 8px; background: #DBEAFE; color: #1E40AF; }
.td-page .todo-row-due { font-weight: 650; }
.td-page .todo-row-due.overdue { color: #BE123C; font-weight: 700; }
.td-page .todo-row-due.soon { color: #C2410C; font-weight: 700; }
.td-page .todo-row-sub-badge { padding: 1px 7px; border-radius: 999px; background: #F1F5F9; color: #475569; font-size: 11px; font-weight: 650; }
.td-page .todo-row-right { gap: 4px; }
.td-page .todo-row-right .badge.sm { padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 750; letter-spacing: .03em; text-transform: uppercase; }
.td-page .todo-row-right .badge.urgent { background: #FFE4E8; color: #BE123C; }
.td-page .todo-row-right .badge.normal { background: #F1F5F9; color: #64748B; }
.td-page .todo-row-right .badge.low { background: #F8FAFC; color: #94A3B8; }
.td-page .todo-row-checkbox { width: 22px; height: 22px; margin: 0; border-radius: 7px; }
.td-page .todo-row-checkbox:not(.done):hover { border-color: #10B981; background: #ECFDF5; color: #10B981; }
.td-page .todo-row-checkbox:not(.done):hover::after { content: "✓"; }
.td-page .todo-row-checkbox.done { background: #10B981; border-color: #10B981; }
.td-page .todo-empty-state { padding: 28px 16px; border: 1px dashed #DCE3DF; border-radius: 12px; background: #fff; }
.td-page .td-list > .btn, .td-page .todo-time-group > .btn, .td-page .todo-section-card > .btn { justify-self: center; margin: 8px auto 0; }

/* rail */
.td-page .td-rc { padding: 14px 16px; border: 1px solid var(--t-line); border-radius: var(--t-radius); background: #fff; box-shadow: var(--t-shadow); }
.td-page .td-rc header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.td-page .td-rc h2 { margin: 0; font-size: 14px; font-weight: 700; }
.td-page .td-rc header button { padding: 0; border: 0; background: none; color: var(--t-em); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.td-page .td-rail-sub { color: var(--t-faint); font-size: 12px; font-weight: 700; }
.td-page .td-rail-empty { margin: 0; color: var(--t-faint); font-size: 12.5px; }
.td-page .td-ring { display: flex; align-items: center; gap: 14px; }
.td-page .td-ring svg { flex: 0 0 auto; }
.td-page .td-ring p { margin: 0; min-width: 0; color: var(--t-muted); font-size: 12.5px; line-height: 1.5; }
.td-page .td-ring b { color: var(--t-ink); }
.td-page .td-linkbtn { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; padding: 0; border: 0; background: none; color: var(--t-em); font: inherit; text-align: left; cursor: pointer; }
.td-page .td-linkbtn:hover { text-decoration: underline; }
.td-page .td-people { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.td-page .td-people button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 4px; border: 0; border-radius: 8px; background: none; color: var(--t-ink-2); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; }
.td-page .td-people button:hover { background: #F6F8F7; }
.td-page .td-people .avatar { flex: 0 0 auto; width: 22px; height: 22px; font-size: 9px; background: #DBEAFE; color: #1E40AF; }
.td-page .td-pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-page .td-pbar { flex: 0 0 64px; height: 6px; overflow: hidden; border-radius: 99px; background: #EEF2F0; }
.td-page .td-pbar i { display: block; height: 100%; border-radius: 99px; background: #10B981; }
.td-page .td-people b { min-width: 14px; text-align: right; font-variant-numeric: tabular-nums; }
.td-page .td-people em { padding: 0 6px; border-radius: 999px; background: #FFE4E8; color: #BE123C; font-size: 10px; font-style: normal; font-weight: 750; }
.td-page .td-week { display: flex; align-items: flex-end; gap: 6px; height: 84px; }
.td-page .td-week span { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.td-page .td-week i { display: block; width: 100%; border-radius: 4px 4px 0 0; background: #A7F3D0; }
.td-page .td-week span.is-today i { background: #10B981; }
.td-page .td-week small { color: var(--t-faint); font-size: 10.5px; font-weight: 650; }

@media (max-width: 1199px) {
  .td-page .td-layout { grid-template-columns: minmax(0, 1fr); }
  .td-page .td-rail { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}
@media (max-width: 767px) {
  .td-page .td-hero { padding: 14px var(--gr) 54px var(--gl); }
  .td-page .td-head { grid-template-columns: minmax(0, 1fr); }
  .td-page .td-acts { justify-content: flex-start; }
  .td-page .td-search { flex: 1 0 100%; }
  .td-page .td-search input.todo-search-inline { width: 100%; }
  .td-page .td-acts .btn { flex: 1; justify-content: center; }
  .td-page .td-stats { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(-1 * var(--gr)) 0 calc(-1 * var(--gl)); padding: 0 var(--gr) 2px var(--gl); scrollbar-width: none; }
  .td-page .td-stats::-webkit-scrollbar { display: none; }
  .td-page .td-bar { padding: 10px; }
  .td-page .td-tabs { flex: 1 1 100%; }
  .td-page .td-seg { margin-left: 0; max-width: 100%; overflow-x: auto; }
  .td-page .todo-filter-bar.td-sub { padding: 8px 10px; }
  .td-page .todo-filter-bar .td-pick select { max-width: 150px; }
  .td-page .td-count { flex: 1 0 100%; margin-left: 0; }
  .td-page .td-list { padding: 2px 10px 10px; }
  .td-page .todo-row { flex-wrap: wrap; padding: 12px 12px 12px 16px; }
  .td-page .todo-row-right { flex-direction: row; align-items: center; justify-content: space-between; width: 100%; }
  .td-page .td-rail { grid-template-columns: minmax(0, 1fr); }
}
