/* Task surfaces share the CRM font, palette and guarded business controls. */
[data-view="tasks"],.task-editor-layer,.task-filter-dialog,.task-unsaved { --task-accent:#0f766e; --task-ink:#172b26; --task-muted:#596b63; --task-line:#e3eae7; --task-bg:#f6f8f7; color:var(--task-ink); font-family:inherit; }
[data-app] .tasks-page { padding:24px 28px; background:var(--task-bg); min-width:0; }
[data-app] .tasks-page-head { align-items:center; margin-bottom:14px; }
[data-app] .tasks-page-head h1 { font-size:28px; font-weight:600; letter-spacing:-.6px; margin:0; }
[data-view="tasks"] :is(button,select,input) { font:inherit; font-size:14px; }
[data-view="tasks"] :is(.primary-button,.ghost-button) { min-height:38px; border-radius:8px; font-weight:500; }
[data-view="tasks"] .primary-button,.task-editor-layer .primary-button { background:var(--task-accent); border-color:var(--task-accent); color:#fff; }
[data-view="tasks"] button { cursor:pointer; }
[data-view="tasks"] .task-scope-tabs { display:flex; flex-wrap:wrap; gap:12px; border-bottom:1px solid var(--task-line); margin-bottom:12px; }
.task-scope-tabs button { padding:10px 2px; border:0; border-bottom:2px solid transparent; background:transparent; color:var(--task-muted); }
.task-scope-tabs button.is-active { border-color:var(--task-accent); color:var(--task-accent); font-weight:600; }
.task-scope-tabs select { margin-left:auto; max-width:160px; border:0; color:var(--task-muted); background:transparent; }
.task-quick-filters { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:12px; }
.task-quick-filters button { display:flex; gap:8px; align-items:center; padding:7px 12px; border:1px solid var(--task-line); border-radius:8px; background:#fff; color:var(--task-muted); min-height:36px; }
.task-quick-filters button.is-active { color:var(--task-accent); background:#e8f5ef; border-color:#c6e3d8; }
.task-quick-filters small { padding:1px 5px; border-radius:5px; background:#edf2f0; font-size:12px; }
[data-app] .task-toolbar { display:flex; gap:8px; padding:0; margin-bottom:8px; background:transparent; border:0; border-radius:0; }
[data-app] .task-search { flex:1; width:auto; min-width:0; background:#fff; border:1px solid var(--task-line); border-radius:8px; height:38px; padding:0 10px; }
[data-app] .task-search input { min-width:0; width:100%; height:36px; border:0; background:transparent; padding:0 0 0 26px; color:var(--task-ink); font-weight:400; }
[data-app] .task-toolbar select { max-width:215px; min-height:38px; padding:6px 10px; border:1px solid var(--task-line); border-radius:8px; background:#fff; }
[data-app] .task-list-heading { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:4px 0 10px; color:var(--task-muted); font-size:12px; }
[data-app] .task-list-heading strong { font-weight:500; }
[data-task-active-filters] { overflow-wrap:anywhere; }
.task-split { display:grid; min-width:0; align-items:start; grid-template-columns:minmax(0,1fr); }
.task-split.has-task-panel { grid-template-columns:minmax(0,1fr) 560px; gap:16px; }
[data-app] .task-main { min-width:0; border:1px solid var(--task-line); border-radius:10px; background:#fff; overflow:visible; }
[data-app] .task-list { display:block; min-height:0; padding:0; }
[data-app] .task-row,.task-table-head { display:grid; grid-template-columns:32px minmax(160px,1fr) 148px minmax(130px,.65fr) 104px 36px; align-items:center; gap:10px; padding:12px 14px; min-width:0; }
.task-table-head { color:var(--task-muted); font-size:12px; padding-top:10px; padding-bottom:10px; }
[data-app] .task-row { min-height:70px; border:0; border-top:1px solid var(--task-line); border-radius:0; background:#fff; position:relative; }
[data-app] .task-row::before { display:none; }
[data-app] .task-row:hover { background:#f4f8f6; }
[data-app] .task-row.is-selected { background:#e8f5ef; box-shadow:inset 3px 0 var(--task-accent); }
[data-app] .task-row.is-saving { opacity:.65; }
[data-app] .task-row.is-error { box-shadow:inset 3px 0 #b42332; }
[data-app] .task-row.is-completed { opacity:1; background:#fafcfb; }
[data-app] .task-row-main { display:grid; gap:4px; padding:0; min-width:0; text-align:left; background:transparent; }
[data-app] .task-row-main > button { display:block; width:100%; border:0; padding:0; text-align:left; background:transparent; color:var(--task-ink); min-width:0; }
[data-app] .task-row-main strong { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; font-size:14px; font-weight:600; line-height:1.4; overflow-wrap:anywhere; }
[data-app] .is-completed .task-row-main strong { text-decoration:line-through; color:var(--task-muted); }
[data-app] .task-row-context { display:block; font-size:12px; line-height:1.4; white-space:normal; overflow-wrap:anywhere; font-weight:400; color:var(--task-muted); }
[data-app] .task-row-context button { border:0; padding:0; color:var(--task-accent); text-decoration:underline; background:transparent; font-size:12px; text-align:left; }
[data-app] .task-row-assignment { font-size:12px; color:var(--task-muted); }
[data-app] .task-row-due { display:grid; gap:3px; font-size:13px; padding:0; min-width:0; }
[data-app] .task-row-due span { font-size:13px; color:var(--task-ink); font-weight:400; white-space:normal; }
[data-app] .task-row-due.is-overdue :is(span,small) { color:#b42332; }
[data-app] .task-row-due small { font-size:12px; }
[data-app] .task-assignee { display:flex; align-items:center; gap:7px; min-width:0; padding:0; }
[data-app] .task-assignee > span { flex:0 0 28px; width:28px; height:28px; margin:0; display:grid; place-items:center; background:#edf2f0; color:var(--task-muted); font-size:10px; font-weight:500; }
[data-app] .task-assignee strong { display:block; min-width:0; white-space:normal; overflow-wrap:anywhere; font-size:12px; font-weight:400; }
.task-status { font-size:11px; font-weight:500; padding:5px 7px; border-radius:6px; color:#075e56; background:#e1f3ed; width:fit-content; white-space:normal; }
.task-status.is-in_progress { color:#07559b; background:#e9f3ff; }
.task-status.is-waiting { color:#77500a; background:#fff5dc; }
.task-status.is-completed,.task-status.is-cancelled { color:var(--task-muted); background:#edf2f0; }
[data-app] .task-complete-button { width:30px; height:30px; border:1px solid #a8b9b1; border-radius:50%; display:grid; place-items:center; padding:0; background:#fff; }
[data-app] .task-complete-button span { width:auto; height:auto; border:0; background:none; color:var(--task-accent); }
[data-app] .task-row-actions { display:block; position:relative; }
.task-row-actions summary,.task-more-menu summary { list-style:none; cursor:pointer; min-width:36px; min-height:36px; display:grid; place-items:center; border-radius:6px; }
.task-row-actions summary::-webkit-details-marker,.task-more-menu summary::-webkit-details-marker { display:none; }
.task-row-actions[open] > div { position:absolute; right:0; top:36px; z-index:10; width:210px; padding:8px; display:grid; background:#fff; border:1px solid var(--task-line); border-radius:8px; box-shadow:0 5px 18px #172b2614; }
.task-row-actions button { border:0; background:#fff; text-align:left; padding:10px; }
.task-row-actions small { padding:6px; font-size:12px; color:var(--task-muted); }
.task-row-message { grid-column:2/-1; color:#b42332; }
.has-task-panel .task-table-head,.has-task-panel .task-row { grid-template-columns:30px minmax(140px,1fr) 100px 36px; gap:8px; }
.has-task-panel .task-table-head > span:nth-child(4),.has-task-panel .task-table-head > span:nth-child(5) { display:none; }
.has-task-panel .task-row .task-status { grid-column:2; grid-row:2; }
.has-task-panel .task-assignee { grid-column:3; grid-row:2; }
.has-task-panel .task-row-actions { grid-column:4; grid-row:1; }
.has-task-panel .task-row .task-complete-button { grid-row:1/3; }
.has-task-panel .task-main { max-height:calc(100dvh - 240px); overflow:auto; scrollbar-gutter:stable; }
.task-template-menu { margin-top:12px; font-size:12px; color:var(--task-muted); }
.task-template-menu summary { width:fit-content; cursor:pointer; }
.task-template-menu div { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.task-template-menu button { padding:8px; border:1px solid var(--task-line); background:#fff; border-radius:8px; }
.task-period-stat { color:var(--task-muted); font-size:12px; margin:14px 0; }
.task-filter-dialog,.task-unsaved { border:1px solid var(--task-line); border-radius:12px; padding:20px; width:min(480px,calc(100vw - 32px)); max-height:calc(100dvh - 32px); box-sizing:border-box; overflow:auto; }
.task-filter-dialog::backdrop,.task-unsaved::backdrop { background:#172b2659; }
.task-filter-dialog form { display:grid; gap:14px; }
.task-filter-dialog header,.task-filter-dialog footer { display:flex; justify-content:space-between; gap:8px; }
.task-filter-dialog h2,.task-unsaved h2 { font-size:20px; margin:0; }
.task-filter-dialog label { display:grid; gap:6px; font-size:13px; }
.task-filter-dialog :is(button,select),.task-unsaved button { min-height:40px; border-radius:8px; border:1px solid var(--task-line); padding:8px 12px; font:inherit; background:#fff; color:var(--task-ink); }
.task-filter-dialog .primary-button { background:var(--task-accent); color:#fff; }
.task-unsaved button { display:block; width:100%; margin-top:8px; }
.task-editor-layer { background:#fff; }
.task-editor-layer.is-docked { position:sticky; top:0; inset:auto; height:calc(100dvh - 92px); z-index:20; display:block; border:1px solid var(--task-line); border-radius:10px; }
.task-editor-layer.is-docked .task-editor-backdrop { display:none; }
.task-editor-layer .task-editor-backdrop { background:none; }
.task-editor-layer .task-editor-panel { width:100%; height:100%; box-shadow:none; background:#fff; grid-template-rows:auto minmax(0,1fr); }
.task-editor-layer .task-editor-header { min-height:56px; padding:10px 18px; gap:8px; border-color:var(--task-line); }
.task-editor-layer .task-editor-header h2 { font-size:15px; font-weight:500; color:var(--task-muted); }
.task-editor-layer .task-editor-header .eyebrow { display:none; }
.task-editor-header-actions { margin-left:auto; display:flex; align-items:center; gap:8px; }
.task-editor-header-actions button { font:inherit; font-size:12px; padding:8px 10px; border:1px solid var(--task-line); border-radius:8px; min-height:36px; color:var(--task-accent); background:#fff; }
.task-editor-layer .task-editor-header [data-task-editor-close] { min-width:36px; min-height:36px; }
.task-editor-layer .task-editor-content { min-height:0; overflow:auto; }
.task-editor-layer .task-form { display:block; padding:0; min-height:0; }
.task-editor-layer .task-form-primary,.task-editor-layer .task-form-section { display:block; min-height:0; padding:14px 18px; border:0; border-bottom:1px solid var(--task-line); border-radius:0; background:#fff; }
.task-editor-layer .task-form-grid { display:grid; align-items:start; align-content:start; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px 16px; grid-auto-rows:auto; min-height:0; }
.task-editor-layer .task-form :is(input,select,textarea) { min-width:0; max-width:100%; font-family:inherit; font-size:14px; font-weight:400; padding:7px 9px; color:var(--task-ink); border-color:var(--task-line); min-height:36px; box-sizing:border-box; border-radius:6px; }
.task-editor-layer .task-form textarea { resize:vertical; height:auto; min-height:40px; overflow:auto; }
.task-editor-layer .task-title-field { margin-bottom:18px; }
.task-editor-layer .task-title-field > span { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.task-editor-layer .task-title-field textarea { width:100%; font-size:24px; line-height:1.3; font-weight:600; border:0; padding:4px 0; min-height:40px; background:transparent; overflow:hidden; resize:none; }
.task-editor-layer .task-form label { font-weight:400; min-height:0; color:var(--task-muted); font-size:12px; }
.task-editor-layer .task-relation-field { display:block; align-self:start; }
.task-editor-layer .task-relation-picker-head { gap:8px; margin-bottom:5px; }
.task-editor-layer .task-relation-picker-head > span { font-weight:400; color:var(--task-muted); }
.task-editor-layer .task-relation-action-slot { margin:0; }
.task-editor-layer .task-relation-link { font-weight:400; color:var(--task-accent); }
.task-editor-layer .additional-assignees-head > span { font-weight:400; }
.task-editor-layer .task-deadline-field { margin:0; padding:0; min-height:0; align-self:start; border:0; }
.task-editor-layer .task-deadline-field legend { font-weight:400; font-size:12px; color:var(--task-muted); }
.task-editor-layer .task-deadline-field legend small { font-size:10px; }
.task-editor-layer .task-deadline-picker { gap:6px; grid-template-columns:repeat(auto-fit,minmax(130px,1fr)); padding:0; border:0; border-radius:0; background:none; box-shadow:none; }
.task-editor-layer .task-deadline-input svg { display:none; }
.task-editor-layer .task-deadline-part-label { display:none; }
.task-editor-layer .task-deadline-part { gap:0; }
.task-editor-layer .task-deadline-input { border:0; padding:0; grid-template-columns:minmax(0,1fr); }
.task-editor-layer .task-deadline-input input { width:100%; min-width:0; }
.task-editor-layer .task-form .task-deadline-input :is(input[type="date"],input[type="time"]) { font-weight:400; padding:7px; border:1px solid var(--task-line); border-radius:6px; }
.task-editor-layer .task-priority-control { display:flex; align-items:center; flex-wrap:wrap; gap:6px; margin:16px 0; padding:0; border:0; background:transparent; }
.task-editor-layer .task-priority-control legend { font-weight:400; font-size:12px; padding:0 0 6px; }
.task-editor-layer .task-priority-control label { flex:0 0 auto; }
.task-editor-layer .task-priority-control label span { min-height:32px; padding:6px 10px; font-size:12px; font-weight:400; }
.task-editor-layer .task-form-section-head { margin:0 0 8px; }
.task-editor-layer .task-form-section-head strong { font-size:13px; font-weight:500; }
.task-editor-layer .task-form-section-head span { font-weight:400; font-size:12px; }
.task-editor-layer .task-form-details summary { font-size:13px; min-height:36px; font-weight:500; }
.task-editor-layer .task-form-details summary small { display:none; }
.task-editor-layer .task-choice-row { gap:6px; }
.task-editor-layer .task-choice-row span { min-height:32px; padding:6px 8px; font-weight:400; font-size:12px; }
.task-editor-layer .task-choice-row label.is-required span { background:#edf6f2; color:#075e56; }
.task-editor-layer .task-choice-row label.is-required span { background-image:none; }
.task-editor-layer .task-choice-row label.is-required small { text-transform:none; font-size:10px; font-weight:400; }
.task-editor-layer .task-watchers > span { font-weight:500; }
.task-editor-layer .task-watchers label span { font-weight:400; }
.task-editor-layer :is(.task-priority-control,.task-choice-row,.task-watchers) label { position:relative; min-width:0; }
.task-editor-layer :is(.task-priority-control,.task-choice-row,.task-watchers) input:not([type="hidden"]) { width:1px; height:1px; min-height:0; padding:0; border:0; inset:0 auto auto 0; clip-path:inset(50%); }
.task-editor-layer :is(.task-priority-control,.task-choice-row,.task-watchers) input:focus-visible + span { outline:2px solid var(--task-accent); outline-offset:3px; }
.task-editor-layer .task-form-actions { display:flex; position:sticky; bottom:0; margin:0; padding:12px 18px calc(12px + env(safe-area-inset-bottom)); gap:8px; background:#fff; border-color:var(--task-line); }
.task-editor-layer .task-form-actions > div { display:flex; flex:1; justify-content:flex-end; gap:8px; }
.task-editor-layer .task-form-actions button { min-height:38px; font-weight:500; font-size:14px; border-radius:8px; }
.task-more-menu { position:relative; }
.task-more-menu[open] button { position:absolute; bottom:44px; left:0; width:180px; padding:10px; background:#fff; border:1px solid var(--task-line); border-radius:8px; box-shadow:0 5px 15px #172b2614; }
.task-editor-layer .task-discussion-tabs { display:flex; gap:16px; padding:0 18px; border-bottom:1px solid var(--task-line); }
.task-discussion-tabs button { min-height:40px; border:0; border-bottom:2px solid transparent; background:#fff; color:var(--task-muted); font-size:13px; }
.task-discussion-tabs button[aria-selected="true"] { color:var(--task-accent); border-bottom-color:var(--task-accent); }
.task-editor-layer .task-comments { max-height:320px; overflow:auto; }
.task-editor-layer .task-comments article div { padding:0; background:none; }
.task-editor-layer .task-comments :is(strong,p,small) { font-weight:400; overflow-wrap:anywhere; }
.task-editor-layer .task-comments strong { font-weight:500; }
.task-editor-layer .task-comments p { white-space:pre-wrap; font-size:14px; }
.task-editor-layer .task-history h3 { font-size:14px; font-weight:500; }
.task-editor-layer .task-history[hidden],.task-editor-layer [data-task-tab-panel][hidden] { display:none; }
.task-editor-layer [data-task-form-message]:not(:empty) { padding:12px 18px; }
.task-editor-layer [data-task-comment-message] { font-size:12px; color:var(--task-muted); }
.task-editor-layer .task-checklist-editor input[type="checkbox"] { min-height:18px; }
:is([data-view="tasks"],.task-editor-layer,.task-filter-dialog,.task-unsaved) :is(button,input,select,textarea,summary):focus-visible { outline:2px solid #0f766e; outline-offset:3px; }
@media (max-width:1199px) {
  [data-app] .task-row,.task-table-head { grid-template-columns:30px minmax(130px,1fr) 135px minmax(100px,.6fr) 92px 32px; gap:8px; padding:10px; }
}
@media (max-width:767px) {
  [data-app] .tasks-page { padding:16px 12px calc(90px + env(safe-area-inset-bottom)); }
  [data-app] .tasks-page-head h1 { font-size:26px; }
  [data-app] [data-view="tasks"] [data-task-create] { position:static; inset:auto; width:auto!important; min-width:0; min-height:44px; padding:8px 12px; font-size:14px; box-shadow:none; }
  [data-view="tasks"] :is(button,select,input) { font-size:15px; }
  .task-scope-tabs { gap:10px; }
  .task-scope-tabs button { font-size:13px!important; min-height:44px; }
  .task-scope-tabs select { margin-left:0; width:100%; max-width:100%; min-height:44px; }
  .task-quick-filters { gap:6px; }
  .task-quick-filters button { min-height:44px; font-size:13px!important; padding:8px; }
  [data-app] .task-toolbar { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:6px; }
  [data-app] .task-search { width:100%; min-height:44px; }
  [data-app] .task-search input { height:42px; font-size:16px; }
  [data-app] .task-toolbar select { width:100%; max-width:100%; min-height:44px; font-size:13px; }
  [data-app] .task-toolbar button { min-height:44px; }
  [data-app] .task-main { border:0; background:transparent; }
  .task-table-head { display:none; }
  [data-app] .task-list { display:grid; gap:8px; }
  [data-app] .task-row { display:grid; grid-template-columns:44px minmax(0,1fr) 44px; grid-template-rows:auto auto auto; gap:3px 6px; padding:8px; border:1px solid var(--task-line); border-radius:8px; align-items:center; }
  [data-app] .task-complete-button { width:44px; height:44px; grid-column:1; grid-row:1/4; }
  [data-app] .task-row-main { grid-column:2; grid-row:1; }
  [data-app] .task-row-main > button { min-height:44px; }
  [data-app] .task-row-main strong { font-size:15px; }
  [data-app] .task-row-context button { min-height:44px; font-size:13px; }
  [data-app] .task-row-due { grid-column:2; grid-row:2; display:flex; flex-wrap:wrap; gap:4px; }
  [data-app] .task-row-due span { display:block; }
  [data-app] .task-assignee { grid-column:2; grid-row:3; padding:2px 0; }
  [data-app] .task-assignee strong { display:block; font-size:12px; }
  [data-app] .task-row .task-status { grid-column:2; grid-row:4; font-size:12px; }
  [data-app] .task-row-actions { grid-column:3; grid-row:1; }
  .task-row-actions summary { min-height:44px; min-width:44px; font-size:14px; }
  [data-app] .task-row-message { grid-column:2/4; }
  .task-editor-layer .task-editor-header { padding:8px 12px; min-height:64px; }
  .task-editor-layer .task-editor-header [data-task-editor-close] { min-width:44px; min-height:44px; }
  .task-editor-header-actions { flex-wrap:wrap; justify-content:flex-end; }
  .task-editor-header-actions button { min-height:44px; font-size:12px; }
  .task-editor-header-actions .task-status { display:block; }
  .task-editor-layer .task-form-primary,.task-editor-layer .task-form-section { padding:12px; }
  .task-editor-layer .task-form-grid { grid-template-columns:minmax(0,1fr); gap:12px; align-content:start; }
  .task-editor-layer .task-form :is(input,select,textarea) { font-size:16px; min-height:44px; }
  .task-editor-layer .task-form .task-deadline-input :is(input[type="date"],input[type="time"]) { font-size:16px; }
  .task-editor-layer .task-title-field textarea { font-size:22px; }
  .task-editor-layer .task-form :is(button,summary) { min-width:44px; min-height:44px; }
  .task-editor-layer .task-checklist-editor-item { grid-template-columns:24px minmax(0,1fr) 44px; }
  .task-editor-layer .task-form :is(.relation-edit-button,.assignee-add-button) { min-width:44px; min-height:44px; font-weight:400; }
  .task-editor-layer .task-form label { font-size:13px; }
  .task-editor-layer .task-choice-row span,.task-editor-layer .task-watchers label span { min-height:44px; padding:12px 8px; }
  .task-editor-layer .task-priority-control label span { min-height:44px; padding:12px 8px; }
  .task-editor-layer .task-form-actions { padding:10px 12px calc(10px + env(safe-area-inset-bottom)); }
  .task-editor-layer .task-form-actions > div { display:grid; grid-template-columns:1fr 1fr; }
  .task-filter-dialog :is(select,input),.task-unsaved :is(select,input) { font-size:16px; }
  .task-filter-dialog button,.task-unsaved button { min-height:44px; }
}
@media (prefers-reduced-motion:reduce) {
  [data-view="tasks"] *, .task-editor-layer * { scroll-behavior:auto; transition:none; }
}
