/* Task Manager — Apple Freeform / Notes style chrome */

#tab-tasks {
  --tm-bg: #f2f2f7;
  --tm-panel: #ffffff;
  --tm-text: #1c1c1e;
  --tm-muted: #8e8e93;
  --tm-border: rgba(60, 60, 67, 0.12);
  --tm-accent: #007aff;
  --tm-accent-muted: rgba(0, 122, 255, 0.12);
  --tm-pill: rgba(118, 118, 128, 0.12);
  --tm-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 20px rgba(0, 0, 0, 0.06);
  background: var(--tm-bg);
  -webkit-font-smoothing: antialiased;
}

[data-theme='dark'] #tab-tasks {
  --tm-bg: #000000;
  --tm-panel: #1c1c1e;
  --tm-text: #f5f5f7;
  --tm-muted: #98989d;
  --tm-border: rgba(84, 84, 88, 0.55);
  --tm-accent: #0a84ff;
  --tm-accent-muted: rgba(10, 132, 255, 0.18);
  --tm-pill: rgba(118, 118, 128, 0.24);
  --tm-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 22px rgba(0, 0, 0, 0.35);
}

#tab-tasks #tmRoot,
#tab-tasks .tm-list-view {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
}

#tab-tasks .tm-page-header {
  box-shadow: none;
  border-bottom: 1px solid var(--tm-border);
  background: transparent;
  position: sticky;
  top: 0;
  z-index: 6;
}

#tab-tasks .tm-toolbar.tm-toolbar--apple {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.7rem;
  margin: 0;
  padding: 0.85rem 1.15rem 0.8rem;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
}

[data-theme='dark'] #tab-tasks .tm-toolbar.tm-toolbar--apple {
  background: rgba(28, 28, 30, 0.82);
}

#tab-tasks .tm-toolbar__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
  min-width: 0;
}

#tab-tasks .tm-toolbar__title-row .edm-emp-header__brand {
  flex: 0 1 auto;
  min-width: 0;
  gap: 0.45rem;
}

#tab-tasks .tm-toolbar__title-row .edm-emp-header__title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--tm-text);
  line-height: 1.15;
  white-space: nowrap;
  margin: 0;
}

#tab-tasks .tm-toolbar__title-row .edm-emp-header__icon {
  width: 2rem;
  height: 2rem;
  border-radius: 9px;
  background: var(--tm-accent-muted);
  color: var(--tm-accent);
  border: 0;
}

#tab-tasks .tm-toolbar__title-row .tm-toolbar__actions {
  margin-left: auto;
  flex: 1 1 auto;
  justify-content: flex-end;
}

#tab-tasks .tm-toolbar__search-create {
  gap: 0.4rem;
}

#tab-tasks .tm-quick-search--toolbar {
  flex: 0 1 18rem;
  min-width: min(11rem, 42vw);
  max-width: 22rem;
}

#tab-tasks .tm-quick-search__input {
  border: 0;
  border-radius: 12px;
  background: var(--tm-pill);
  color: var(--tm-text);
  font-weight: 550;
  letter-spacing: -0.01em;
  box-shadow: none;
  padding: 0.48rem 1.9rem 0.48rem 0.75rem;
}

#tab-tasks .tm-quick-search__input:focus {
  outline: none;
  border-color: transparent;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.22);
  background: #fff;
}

[data-theme='dark'] #tab-tasks .tm-quick-search__input:focus {
  background: #2c2c2e;
}

#tab-tasks .tm-quick-search__clear {
  color: var(--tm-muted);
}

#tab-tasks .tm-quick-search__clear:hover {
  color: var(--tm-text);
  background: rgba(118, 118, 128, 0.18);
}

#tab-tasks .tm-toolbar__actions .btn.primary.tm-create,
#tab-tasks .tm-toolbar__actions .inat-create__toolbar-btn {
  border: 0;
  border-radius: 10px;
  min-height: 2.05rem;
  padding: 0.4rem 0.85rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  background: var(--tm-accent);
  color: #fff;
  transition: transform 0.08s ease, background 0.12s ease;
}

#tab-tasks .tm-toolbar__actions .btn.primary.tm-create:active {
  transform: scale(0.97);
}

#tab-tasks .tm-toolbar--apple > .tm-tabs {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.18rem;
  margin: 0.05rem 0 0;
  padding: 0.2rem;
  border-radius: 11px;
  background: var(--tm-pill);
  border-bottom: none;
  align-self: flex-start;
}

#tab-tasks .tm-toolbar--apple > .tm-tabs .tm-tab {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  background: transparent;
  color: #3a3a3c;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.2;
  text-transform: none;
  cursor: pointer;
}

[data-theme='dark'] #tab-tasks .tm-toolbar--apple > .tm-tabs .tm-tab {
  color: #ebebf5;
}

#tab-tasks .tm-toolbar--apple > .tm-tabs .tm-tab:hover {
  color: var(--tm-text);
  border-color: transparent;
}

#tab-tasks .tm-toolbar--apple > .tm-tabs .tm-tab.is-active {
  background: #fff;
  color: var(--tm-text);
  border-color: transparent;
  box-shadow: 0 0.5px 1px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
}

[data-theme='dark'] #tab-tasks .tm-toolbar--apple > .tm-tabs .tm-tab.is-active {
  background: #3a3a3c;
  color: #f5f5f7;
  box-shadow: none;
}

#tab-tasks .tm-toolbar--apple > .tm-tabs .tm-tab__count {
  border: 0;
  background: rgba(118, 118, 128, 0.16);
  color: var(--tm-muted);
  font-weight: 700;
}

#tab-tasks .tm-toolbar--apple > .tm-tabs .tm-tab.is-active .tm-tab__count {
  background: var(--tm-accent-muted);
  color: var(--tm-accent);
  border: 0;
}

#tab-tasks .tm-tag-strip {
  margin: 0;
  padding: 0.55rem 1.15rem 0.65rem;
  border-top: 1px solid var(--tm-border);
  background: rgba(255, 255, 255, 0.55);
}

[data-theme='dark'] #tab-tasks .tm-tag-strip {
  background: rgba(28, 28, 30, 0.55);
}

#tab-tasks .work-tag-filter-chip {
  border: 0;
  border-radius: 999px;
  transform: none;
}

#tab-tasks .work-tag-filter-chip:hover {
  transform: none;
  filter: none;
}

#tab-tasks .work-tag-filter-chip.is-active {
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.35);
}

#tab-tasks .tm-layout {
  padding: 0.85rem 1.15rem 1.25rem;
}

#tab-tasks .tm-err {
  margin: 0.55rem 1.15rem 0;
}

#tab-tasks .tm-table-wrap {
  border: 1px solid var(--tm-border);
  border-radius: 16px;
  background: var(--tm-panel);
  box-shadow: var(--tm-shadow);
  overflow: auto;
}

#tab-tasks .tm-data-table thead th {
  background: rgba(242, 242, 247, 0.96);
  color: var(--tm-muted);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--tm-border);
}

[data-theme='dark'] #tab-tasks .tm-data-table thead th {
  background: rgba(44, 44, 46, 0.96);
}

#tab-tasks .tm-data-table tbody td {
  border-bottom: 1px solid var(--tm-border);
  color: var(--tm-text);
}

#tab-tasks .tm-data-table tbody tr:hover td,
#tab-tasks .tm-table-row:hover {
  background: rgba(0, 122, 255, 0.05);
}

#tab-tasks .tm-status-chip {
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

#tab-tasks .tm-list-pager {
  margin-top: 0.75rem;
  gap: 0.45rem;
}

#tab-tasks .tm-list-pager button {
  border: 0;
  border-radius: 10px;
  background: var(--tm-pill);
  color: var(--tm-accent);
  font-weight: 650;
  letter-spacing: -0.01em;
  min-height: 2rem;
  padding: 0.35rem 0.75rem;
}

#tab-tasks .tm-list-pager button:hover:not([disabled]) {
  background: var(--tm-accent-muted);
}

#tab-tasks .tm-cards .tm-task-card,
#tab-tasks .tm-task-card {
  border: 1px solid var(--tm-border);
  border-radius: 14px;
  background: var(--tm-panel);
  box-shadow: var(--tm-shadow);
}

@media (max-width: 720px) {
  #tab-tasks .tm-toolbar.tm-toolbar--apple {
    padding: 0.75rem 0.9rem 0.7rem;
  }

  #tab-tasks .tm-toolbar__title-row {
    flex-direction: column;
    align-items: stretch;
  }

  #tab-tasks .tm-toolbar__title-row .tm-toolbar__actions {
    margin-left: 0;
    width: 100%;
  }

  #tab-tasks .tm-toolbar__search-create {
    width: 100%;
  }

  #tab-tasks .tm-quick-search--toolbar {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
  }

  #tab-tasks .tm-layout {
    padding: 0.75rem 0.9rem 1rem;
  }

  #tab-tasks .tm-tag-strip {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }
}
