/* Task workspace: independent scope/view controls, shared list/board filters.
   Loaded after workspace-lists.css; all colors use the workspace theme. */
.reback .workspace-theme .tasks-page-header { display: flex; flex-direction: row; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; min-height: 44px; }
.reback .workspace-theme .tasks-heading-group { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; min-width: 0; }
.reback .workspace-theme .tasks-page-header .page-title { font-size: 22px; white-space: nowrap; }
.reback .workspace-theme .tasks-page-header .page-actions { margin-left: auto; }
.reback .workspace-theme .task-workspace-switches { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; min-width: 0; }
.reback .workspace-theme .tasks-page-header .task-toolbar { margin: 0; align-self: auto; }
.reback .workspace-theme .tasks-page-header .task-toolbar .btn { font-size: 12px; padding-inline: 11px; }
.reback .workspace-theme .task-trash-link { width: 36px; min-height: 36px; padding: 8px; color: var(--ws-muted); }
.reback .workspace-theme .task-trash-link[aria-current="page"] { background: var(--ws-accent-soft); color: var(--ws-accent); border-color: var(--ws-accent); }
.reback .workspace-theme .tasks-workspace { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.reback .workspace-theme .tasks-workspace .task-filter-panel { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 0; margin: 0; padding: 12px; }
.reback .workspace-theme .task-filter-panel .filter-main { display: grid; grid-template-columns: minmax(180px, 1.5fr) repeat(2, minmax(160px, 1fr)); gap: 10px; margin-bottom: 10px; }
.reback .workspace-theme .task-filter-panel.is-external .filter-main { grid-template-columns: minmax(180px, 1.5fr) minmax(160px, 1fr); }
.reback .workspace-theme .task-filter-panel .task-filter-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(180px, 1.5fr) 145px 40px; gap: 10px; }
.reback .workspace-theme .task-filter-panel :is(.filter-main, .task-filter-tools) > .field { min-width: 0; gap: 0; margin: 0; }
.reback .workspace-theme .task-filter-panel :is(.filter-main, .task-filter-tools) :is(.input, .combobox-control),
.reback .workspace-theme .task-filter-panel .task-filter-reset { height: 40px; min-height: 40px; padding: 8px 11px; font-size: 13px; }
.reback .workspace-theme .task-filter-panel .task-filter-reset { grid-column: 6; display: inline-flex; align-items: center; justify-content: center; width: 40px; padding: 0; }
.reback .workspace-theme .task-filter-reset-label { display: none; }
.reback .workspace-theme .task-filter-panel .filter-more { min-width: 0; margin: 0; padding: 0; border: 0; }
.reback .workspace-theme .task-filter-panel .filter-more > summary { position: absolute; top: 62px; right: 62px; display: flex; align-items: center; justify-content: center; gap: 6px; width: 145px; min-height: 40px; margin: 0; padding: 8px; border: 1px solid var(--ws-field-border); border-radius: 8px; background: var(--ws-surface); color: var(--ws-text); font-size: 12px; font-weight: 600; cursor: pointer; list-style: none; }
.reback .workspace-theme .task-filter-panel .filter-more > summary::-webkit-details-marker { display: none; }
.reback .workspace-theme .task-filter-panel .filter-more > summary::marker { content: ''; }
.reback .workspace-theme .task-filter-panel .filter-more > summary:hover { background: var(--ws-subtle); color: var(--ws-accent); }
.reback .workspace-theme .task-filter-panel .filter-more[open] > summary { background: var(--ws-accent-soft); color: var(--ws-accent); border-color: var(--ws-accent); }
.reback .workspace-theme .task-filter-panel .filter-more[open] .task-filter-chevron { transform: rotate(180deg); }
.reback .workspace-theme .task-filter-panel .filter-more > .business-filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--ws-border); }
.reback .workspace-theme .task-filter-panel .filter-more .field > label { font-size: 12px; }
.reback .workspace-theme .task-filter-panel .active-filter-list { margin: 10px 0 0; padding: 0; }
.reback .workspace-theme .task-filter-panel > noscript { margin-top: 10px; }

.reback .workspace-theme .tasks-workspace .task-list-table thead th { padding: 10px 14px; font-size: 12px; }
.reback .workspace-theme .tasks-workspace .task-list-table tbody td { padding: 10px 14px; font-size: 13px; line-height: 1.5; }
.reback .workspace-theme .tasks-workspace .task-list-table .task-name-cell { width: 40%; }
.reback .workspace-theme .tasks-workspace .task-list-table .task-status { min-height: 23px; padding: 3px 7px; }
.reback .workspace-theme .tasks-workspace .task-list-context { display: flex; flex-wrap: wrap; gap: 2px 9px; margin-top: 3px; color: var(--ws-muted); font-size: 12px; font-weight: 400; overflow-wrap: anywhere; }
.reback .workspace-theme .tasks-workspace .task-list-context > span + span::before { content: '·'; margin-right: 9px; }
.reback .workspace-theme .tasks-workspace .pager { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin: 0; font-size: 12px; }
.reback .workspace-theme .tasks-workspace .pager > .muted { margin-right: auto; }

.reback .workspace-theme .tasks-workspace .board-help { display: flex; align-items: center; gap: 6px; margin: -3px 0 0; font-size: 12px; }
.reback .workspace-theme .tasks-workspace .board.task-board { gap: 12px; height: calc(100dvh - 350px); min-height: 320px; padding: 0 0 10px; scroll-snap-type: x proximity; }
.reback .workspace-theme .tasks-workspace .col.task-column { flex: 1 0 264px; gap: 0; min-width: 264px; min-height: 0; padding: 10px; overflow: hidden; }
.reback .workspace-theme .tasks-workspace .task-column-cards { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior-y: contain; scrollbar-width: thin; scrollbar-color: var(--ws-field-border) transparent; padding: 2px 1px 3px; }
.reback .workspace-theme .tasks-workspace .task-column .col-head { display: flex; align-items: center; gap: 7px; min-height: 30px; margin: 0 0 10px; }
.reback .workspace-theme .tasks-workspace .task-column h2 { min-width: 0; font-size: 13px; line-height: 1.5; }
.reback .workspace-theme .tasks-workspace .task-column-count { min-width: 22px; border-radius: 6px; padding: 2px 6px; background: var(--ws-surface); font-size: 12px; text-align: center; }
.reback .workspace-theme .tasks-workspace .kcard.task-card { display: flex; flex-direction: column; gap: 9px; margin: 0 0 9px; padding: 12px; }
.reback .workspace-theme .tasks-workspace .kcard.task-card:last-child { margin-bottom: 0; }
.reback .workspace-theme .tasks-workspace .task-card .kcard-heading { align-items: flex-start; gap: 5px; margin: 0; }
.reback .workspace-theme .tasks-workspace .task-card .kcard-title { font-size: 13px; line-height: 1.5; text-wrap: initial; }
.reback .workspace-theme .tasks-workspace .task-drag-handle { flex-shrink: 0; min-width: 28px; width: 28px; min-height: 28px; height: 28px; margin: -3px -4px -3px 0; padding: 5px; border: 0; background: transparent; color: var(--ws-muted); touch-action: none; cursor: grab; }
.reback .workspace-theme .tasks-workspace .task-drag-handle:hover { color: var(--ws-accent); background: var(--ws-accent-soft); }
.reback .workspace-theme .tasks-workspace .task-drag-handle[aria-pressed="true"] { cursor: grabbing; background: var(--ws-accent-soft); color: var(--ws-accent); }
.reback .workspace-theme .tasks-workspace .kcard-context { display: grid; gap: 3px; min-width: 0; }
.reback .workspace-theme .tasks-workspace .task-card .kcard-partner { align-items: flex-start; gap: 5px; margin: 0; color: var(--ws-muted); font-size: 12px; line-height: 1.5; }
.reback .workspace-theme .tasks-workspace .task-card .kcard-partner > .icon { width: 13px; height: 13px; margin-top: 2px; }
.reback .workspace-theme .tasks-workspace .task-card .kcard-partner:hover { color: var(--ws-accent); }
.reback .workspace-theme .tasks-workspace .kcard-checklist { display: flex; align-items: center; gap: 8px; min-width: 0; margin: 0; }
.reback .workspace-theme .tasks-workspace .kcard-checklist progress { flex: 1; min-width: 0; height: 4px; }
.reback .workspace-theme .tasks-workspace .kcard-checklist > span { font-size: 12px; }
.reback .workspace-theme .tasks-workspace .kcard-foot { display: flex; align-items: center; justify-content: initial; flex-wrap: wrap; gap: 5px 8px; margin: 0; padding: 0; }
.reback .workspace-theme .tasks-workspace .kcard-foot .task-priority { min-height: 22px; padding: 2px 0; font-size: 12px; }
.reback .workspace-theme .tasks-workspace .kcard-foot .task-priority:is([data-task-priority="2"], [data-task-priority="3"]) { padding-inline: 6px; }
.reback .workspace-theme .tasks-workspace .kcard-foot .av { flex: none; width: 25px; height: 25px; margin-left: auto; font-size: 12px; }
.reback .workspace-theme .tasks-workspace .kcard-due { display: inline-flex; align-items: center; gap: 4px; color: var(--ws-muted); font-size: 12px; line-height: 1.5; }
.reback .workspace-theme .tasks-workspace .kcard-due .icon { width: 13px; height: 13px; }
.reback .workspace-theme .tasks-workspace .kcard-due.is-done { color: var(--ws-success); }
.reback .workspace-theme .tasks-workspace .kcard-due.is-overdue { color: var(--ws-danger); font-weight: 650; }
.reback .workspace-theme .tasks-workspace .kcard-due.is-today { color: var(--ws-accent); font-weight: 650; }
.reback .workspace-theme .tasks-workspace .kcard-status { min-width: 0; margin: 0; padding: 0; border: 0; }
.reback .workspace-theme .tasks-workspace .kcard-status > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; margin: 0; padding: 4px 0 0; border-top: 1px solid var(--ws-border); color: var(--ws-muted); font-size: 12px; font-weight: 500; cursor: pointer; list-style: none; }
.reback .workspace-theme .tasks-workspace .kcard-status > summary::-webkit-details-marker { display: none; }
.reback .workspace-theme .tasks-workspace .kcard-status > summary::marker { content: ''; }
.reback .workspace-theme .tasks-workspace .kcard-status > summary:hover { color: var(--ws-accent); }
.reback .workspace-theme .tasks-workspace .kcard-status[open] > summary .icon { transform: rotate(180deg); }
.reback .workspace-theme .tasks-workspace .kcard-status > form { display: flex; align-items: center; gap: 7px; margin-top: 7px; }
.reback .workspace-theme .tasks-workspace .kcard-status > form .field { flex: 1; min-width: 0; }
.reback .workspace-theme .tasks-workspace .kcard-status :is(select, .combobox-control) { min-height: 34px; height: 34px; padding: 6px 9px; font-size: 12px; }
.reback .workspace-theme .tasks-workspace .kcard-status > form > .btn { flex: none; width: 34px; min-height: 34px; padding: 7px; }
.reback .workspace-theme .tasks-workspace .col-empty { display: grid; place-items: center; min-height: 76px; margin: 0; padding: 12px; border: 1px dashed var(--ws-border); border-radius: 8px; color: var(--ws-muted); font-size: 12px; }

@media (max-width: 1199px) {
  .reback .workspace-theme .task-filter-panel .filter-main { grid-template-columns: minmax(160px, 1.3fr) repeat(2, minmax(0, 1fr)); }
  .reback .workspace-theme .task-filter-panel .task-filter-tools { grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(150px, 1.3fr) 128px 40px; }
  .reback .workspace-theme .task-filter-panel .filter-more > summary { width: 128px; gap: 4px; font-size: 12px; }
}
@media (max-width: 991px) {
  .reback .workspace-theme .tasks-heading-group { gap: 10px; }
  .reback .workspace-theme .tasks-workspace .task-filter-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .reback .workspace-theme .task-filter-panel :is(.filter-main, .task-filter-tools) { display: contents; }
  .reback .workspace-theme .task-filter-panel .task-search-filter { grid-column: 1 / -1; grid-row: 1; }
  .reback .workspace-theme .task-filter-panel .task-owner-filter { grid-column: 1; grid-row: 2; }
  .reback .workspace-theme .task-filter-panel .task-customer-filter { grid-column: 2; grid-row: 2; }
  .reback .workspace-theme .task-filter-panel.is-external .task-owner-filter { grid-column: 1 / -1; }
  .reback .workspace-theme .task-filter-panel .task-status-filter { grid-column: 1; grid-row: 3; }
  .reback .workspace-theme .task-filter-panel .task-state-filter { grid-column: 2; grid-row: 3; }
  .reback .workspace-theme .task-filter-panel .task-due-filter { grid-column: 1; grid-row: 4; }
  .reback .workspace-theme .task-filter-panel .task-sort-filter { grid-column: 2; grid-row: 4; }
  .reback .workspace-theme .task-filter-panel .task-filter-reset { grid-column: 2; grid-row: 5; align-self: start; width: 100%; font-size: 12px; }
  .reback .workspace-theme .task-filter-reset-label { display: inline; }
  .reback .workspace-theme .task-filter-panel .filter-more { grid-column: 1 / -1; grid-row: 5; }
  .reback .workspace-theme .task-filter-panel .filter-more > summary { position: static; width: calc(50% - 5px); min-height: 40px; font-size: 12px; }
  .reback .workspace-theme .task-filter-panel .filter-more > .business-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 10px; }
  .reback .workspace-theme .task-filter-panel .active-filter-list { grid-column: 1 / -1; margin-top: 0; }
  .reback .workspace-theme .tasks-workspace .board.task-board { height: calc(100dvh - 520px); }
}
@media (max-width: 767px) {
  .reback .workspace-theme .tasks-page-header { position: relative; gap: 12px; }
  .reback .workspace-theme .tasks-heading-group { width: 100%; flex-direction: column; align-items: flex-start; gap: 14px; }
  .reback .workspace-theme .tasks-page-header .page-title { min-height: 44px; display: flex; align-items: center; padding-right: 108px; font-size: 20px; }
  .reback .workspace-theme .tasks-page-header .page-actions { position: absolute; top: 0; right: 0; margin: 0; }
  .reback .workspace-theme .tasks-page-header .page-actions .btn { min-height: 44px; padding: 9px 11px; font-size: 12px; }
  .reback .workspace-theme .task-workspace-switches { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 8px; width: 100%; }
  .reback .workspace-theme .tasks-page-header .task-toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; padding: 3px; gap: 2px; }
  .reback .workspace-theme .tasks-page-header .task-scope-toolbar { grid-column: 1 / -1; }
  .reback .workspace-theme .tasks-page-header .task-toolbar .btn { min-height: 44px; padding: 7px 5px; font-size: 12px; }
  .reback .workspace-theme .task-trash-link { width: 44px; min-height: 44px; }
  .reback .workspace-theme .tasks-workspace { gap: 12px; }
  .reback .workspace-theme .tasks-workspace .task-filter-panel { padding: 10px; }
  .reback .workspace-theme .task-filter-panel :is(.filter-main, .task-filter-tools) :is(.input, .combobox-control),
  .reback .workspace-theme .task-filter-panel .task-filter-reset { min-height: 44px; height: 44px; font-size: 16px; }
  .reback .workspace-theme .task-filter-panel .task-filter-reset { font-size: 12px; }
  .reback .workspace-theme .task-filter-panel .filter-more > summary { min-height: 44px; padding: 8px; gap: 5px; font-size: 12px; }
  .reback .workspace-theme .task-filter-panel .filter-more > summary > .icon:first-child { display: none; }
  .reback .workspace-theme .task-filter-panel .filter-more > .business-filter-grid { gap: 12px 10px; }
  .reback .workspace-theme .task-filter-panel .filter-more .combobox-control { min-height: 44px; }
  .reback .workspace-theme .tasks-workspace .task-mobile-row { padding: 12px; gap: 7px; }
  .reback .workspace-theme .tasks-workspace .task-mobile-title { font-size: 13px; }
  .reback .workspace-theme .tasks-workspace .task-mobile-title a { display: block; min-height: 44px; padding-block: 11px; }
  .reback .workspace-theme .tasks-workspace .board-help { align-items: flex-start; font-size: 12px; }
  .reback .workspace-theme .tasks-workspace .board-help > .icon { margin-top: 2px; }
  .reback .workspace-theme .tasks-workspace .board.task-board { height: calc(100dvh - 640px); min-height: 280px; }
  .reback .workspace-theme .tasks-workspace .col.task-column { flex: 0 0 min(292px, calc(100vw - 56px)); min-width: 0; padding: 9px; }
  .reback .workspace-theme .tasks-workspace .kcard.task-card { padding: 10px; gap: 8px; }
  .reback .workspace-theme .tasks-workspace .task-drag-handle { width: 44px; min-width: 44px; height: 44px; min-height: 44px; margin: -6px -7px -4px 0; padding: 14px; }
  .reback .workspace-theme .tasks-workspace .task-card .kcard-title { display: flex; align-items: center; min-height: 44px; }
  .reback .workspace-theme .tasks-workspace .task-card .kcard-partner { min-height: 44px; align-items: center; font-size: 12px; }
  .reback .workspace-theme .tasks-workspace .task-card .kcard-partner > .icon { margin-top: 0; }
  .reback .workspace-theme .tasks-workspace .kcard-status > summary { min-height: 44px; padding-top: 0; font-size: 12px; }
  .reback .workspace-theme .tasks-workspace .kcard-status :is(select, .combobox-control) { min-height: 44px; height: 44px; font-size: 14px; }
  .reback .workspace-theme .tasks-workspace .kcard-status > form > .btn { width: 44px; min-height: 44px; }
}

/* On narrow screens, keep the everyday inputs visible and move the same
   status/state/due controls into the existing disclosure (task-filters.js). */
@media (max-width: 991px) {
  .reback .workspace-theme .task-filter-panel[data-task-compact] .task-search-filter { padding-right: 50px; }
  .reback .workspace-theme .task-filter-panel[data-task-compact] .task-sort-filter { grid-column: 1; grid-row: 3; }
  .reback .workspace-theme .task-filter-panel[data-task-compact] .task-filter-reset { position: absolute; top: 12px; right: 12px; width: 40px; grid-column: auto; grid-row: auto; padding: 0; }
  .reback .workspace-theme .task-filter-panel[data-task-compact] .task-filter-reset-label { display: none; }
  .reback .workspace-theme .task-filter-panel[data-task-compact] .filter-more { grid-row: 3; }
  .reback .workspace-theme .task-filter-panel[data-task-compact] .filter-more > summary { width: calc(50% - 5px); margin-left: calc(50% + 5px); }
  .reback .workspace-theme .task-filter-panel[data-task-compact] .business-filter-grid > .field { grid-column: auto; grid-row: auto; }
  .reback .workspace-theme .task-filter-panel[data-task-compact] .business-filter-grid .field > .sr-only { position: static; width: auto; height: auto; margin: 0; padding: 0; overflow: visible; clip-path: none; white-space: normal; }
  .reback .workspace-theme .tasks-workspace.has-compact-filters .board.task-board { height: calc(100dvh - 430px); }
}
@media (max-width: 767px) {
  .reback .workspace-theme .tasks-workspace .task-filter-panel[data-task-compact] { gap: 8px; }
  .reback .workspace-theme .task-filter-panel[data-task-compact] .task-search-filter { padding-right: 52px; }
  .reback .workspace-theme .task-filter-panel[data-task-compact] .task-filter-reset { top: 10px; right: 10px; width: 44px; }
  .reback .workspace-theme .task-filter-panel[data-task-compact] .filter-more > summary { width: calc(50% - 4px); margin-left: calc(50% + 4px); }
  .reback .workspace-theme .tasks-workspace.has-compact-filters .board.task-board { height: calc(100dvh - 486px); min-height: 280px; }
}
