/* Shared task/ticket presentation, scoped to the work area. */
#tasks .task-kind-icon{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex:0 0 24px;color:var(--muted);vertical-align:middle}
#tasks .task-kind-icon svg{width:20px;height:20px;flex-shrink:0}
#tasks .task-priority-mark{display:inline-block;flex:0 0 10px;width:10px;height:10px;border-radius:50%;background:var(--tkt-color);box-shadow:0 0 0 3px color-mix(in srgb,var(--tkt-color) 12%,transparent);margin:4px}
#tasks .task-title-line,#tasks .task-card-heading{display:flex;align-items:flex-start;gap:10px;min-width:0}
#tasks .task-title-line>.tk-task-text,#tasks .task-card-heading>.tk-c-title{min-width:0;flex:1}
#tasks .task-card-heading>.task-priority-mark{margin-top:7px}
#tasks .task-row-meta{display:block;margin-top:6px;font:400 12px/1.5 Inter,system-ui,sans-serif;color:var(--muted);overflow-wrap:anywhere;white-space:normal}
html #tasks.dz-tk:not(#old):not(#legacy) .tk-list{table-layout:fixed;min-width:660px;width:100%}
html #tasks.dz-tk:not(#old):not(#legacy) .tk-list th:nth-child(1){width:44px!important}
html #tasks.dz-tk:not(#old):not(#legacy) .tk-list th:nth-child(2){width:auto!important}
html #tasks.dz-tk:not(#old):not(#legacy) .tk-list th:nth-child(3){width:132px!important}
html #tasks.dz-tk:not(#old):not(#legacy) .tk-list th:nth-child(4),html #tasks.dz-tk:not(#old):not(#legacy) .tk-list th:nth-child(5){width:150px!important}
#tasks .task-identity-cell{white-space:nowrap}
#tasks .task-select{display:inline-flex;align-items:center;justify-content:center;min-height:44px;width:44px;margin:0 0 0 4px;vertical-align:middle;cursor:pointer}
#tasks .tk-list .task-select input{margin:0}
#tasks .task-type-sort{float:right;min-width:32px}
#tasks .task-work-card{padding:16px!important;border:1px solid var(--line)!important;border-radius:var(--r-lg);box-shadow:none!important;text-align:left;color:var(--ink);background:var(--panel);font:inherit}
#tasks .task-work-card:after{display:none}
#tasks .task-work-card .tk-c-title{font:600 14px/1.5 Inter,system-ui,sans-serif;white-space:normal;overflow-wrap:anywhere;margin:0}
#tasks .task-work-card .task-row-meta{padding-left:34px}
#tasks .task-work-card .tk-c-when,#tasks .task-work-card .tk-c-foot{font:400 12px/1.5 Inter,system-ui,sans-serif;margin:10px 0 0;padding-left:34px;color:var(--muted)}
#tasks .task-work-card:focus-visible{outline:2px solid var(--green-fill);outline-offset:3px}
@media(max-width:700px){
 html #tasks.dz-tk:not(#old):not(#legacy) .tk-list{display:block;min-width:0}
 #tasks .tk-list thead,#tasks .tk-list tbody{display:block}
 #tasks .tk-list thead tr{display:grid;grid-template-columns:44px minmax(0,1fr) 120px;align-items:center}
 #tasks .tk-list th:nth-child(4),#tasks .tk-list th:nth-child(5){display:none}
 html #tasks.dz-tk:not(#old):not(#legacy) .tk-list th{width:auto!important;min-width:0}
 #tasks .tk-list tbody tr{display:grid;grid-template-columns:44px minmax(0,1fr);padding:12px 10px;border-top:1px solid var(--line)}
 html #tasks.dz-tk:not(#old):not(#legacy) .tk-list td{display:block;width:auto!important;min-width:0;padding:3px 0;border:0;white-space:normal;overflow:visible;line-height:1.5}
 #tasks .tk-list .task-identity-cell{grid-column:1;grid-row:1/5;display:flex!important;align-items:flex-start;justify-content:flex-start;gap:4px;padding-top:2px!important}
 #tasks .tk-list .task-select{min-height:44px;margin:0}
 #tasks .tk-list td:nth-child(2),#tasks .tk-list td:nth-child(3),#tasks .tk-list td:nth-child(4),#tasks .tk-list td:nth-child(5){grid-column:2}
 #tasks .tk-list .tk-task-text,#tasks .tk-list .tkt-title-link{white-space:normal;overflow-wrap:anywhere}
 #tasks .tk-list td:nth-child(4):before{content:'Ответственный: ';color:var(--muted);font-size:12px}
 #tasks .tk-list td:nth-child(5):before{content:'Клиент: ';color:var(--muted);font-size:12px}
 #tasks .tk-list td:nth-child(5) .tkt-link{display:inline;white-space:normal}
 #tasks .tk-list .dz-who{display:inline-flex}
 #tasks .tk-list .tk-sort-button{font-size:10px!important}
 #tasks .task-type-sort{min-width:44px}
 #tasks .tk-listfoot{flex-wrap:wrap;gap:10px}
}
#tasks .tk-list td:nth-child(2){color:var(--ink)!important}
@media(max-width:700px){
 html #tasks.dz-tk:not(#old):not(#legacy) .tk-list th:nth-child(n){width:auto!important;white-space:normal}
 html #tasks.dz-tk:not(#old):not(#legacy) .tk-list .tk-sort-button{white-space:normal;max-width:100%;min-width:0}
}
#tasks #tkBody .task-work-card.tk-card:before{display:none;content:none}
@media(max-width:700px){
 #tasks .tk-list .task-heading-label{font-size:0}
 #tasks .tk-list .task-heading-label:after{content:attr(data-short);font-size:10px}
 html #tasks.dz-tk:not(#old):not(#legacy) .tk-list .tk-sort-button{min-height:44px!important}
 #tasks .tk-list .task-type-sort{min-width:44px!important}
}

#tasks .task-sort-type-label{font:inherit}
#tasks .tk-list .tkt-title-link{color:var(--ink)!important}

#tasks .task-identity-cell{text-align:center}
#tasks .task-selection-toggle{min-height:44px}
#tasks .task-select{margin:0}
@media(max-width:700px){#tasks .tk-list .task-identity-cell{justify-content:center}}
#tasks .tk-list .task-identity-cell,#tasks .tk-list th:first-child{padding-left:0!important;padding-right:0!important}
/* Compact board cards: action, optional client and deadline. */
#tasks #tkBody .tk-board .task-board-compact{padding:10px 12px!important;min-height:52px}
#tasks #tkBody .tk-board .task-board-compact .task-card-heading{gap:8px;align-items:flex-start}
#tasks #tkBody .tk-board .task-board-compact .tk-c-title{font:600 13px/1.4 Inter,system-ui,sans-serif;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;max-height:2.8em;overflow:hidden;padding:0;white-space:normal}
#tasks #tkBody .tk-board .task-board-compact .task-kind-icon{width:20px;height:20px;flex-basis:20px}
#tasks #tkBody .tk-board .task-board-compact .task-kind-icon svg{width:18px;height:18px}
#tasks #tkBody .tk-board .task-board-compact .task-priority-mark{margin-top:5px}
#tasks .task-board-meta{display:flex;align-items:center;gap:8px;margin-top:6px;padding-left:28px;font:400 12px/1.5 Inter,system-ui,sans-serif;color:var(--muted);min-width:0}
#tasks .task-board-client{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#tasks .task-board-date{margin-left:auto;white-space:nowrap;flex-shrink:0}
/* List: compact subject, consistent people and urgency on the identity icon. */
@media(min-width:701px){
 html #tasks.dz-tk:not(#old):not(#legacy) .tk-list th:nth-child(2){width:38%!important}
 html #tasks.dz-tk:not(#old):not(#legacy) .tk-list th:nth-child(4){width:24%!important}
 html #tasks.dz-tk:not(#old):not(#legacy) .tk-list th:nth-child(5){width:auto!important}
 html #tasks.dz-tk:not(#old):not(#legacy) .tk-list td{padding-top:10px;padding-bottom:10px;height:44px;box-sizing:border-box}
}
#tasks .tk-list .task-assignee-name{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#tasks .tk-list .task-kind-icon[class*="tkt-"]{color:var(--tkt-color)}
#tasks .tk-list .task-kind-icon.task-urgency-overdue{color:var(--overdue)}
#tasks .tk-list .task-kind-icon.task-urgency-today{color:var(--ink-orange)}
#tasks .tk-list .task-kind-icon{border-radius:6px;background:color-mix(in srgb,currentColor 9%,transparent)}

#tasks .tk-list .task-row-meta{display:none}
#tasks .tk-list [data-tk-sort="date"]{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
@media(max-width:700px){
 #tasks .tk-list .task-assignee-name{display:inline;white-space:normal;overflow-wrap:anywhere}
 #tasks .tk-list .tk-task-text{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
}
/* Small quick-edit sheet and explicit review, using the existing CRM palette. */
#tasks .tk-list td:nth-child(2){position:relative;padding-right:48px}
#tasks .tk-list .task-quick-button{position:absolute;right:3px;top:50%;transform:translateY(-50%);width:40px;height:40px;border:0;border-radius:var(--r-sm);color:var(--muted);background:transparent;font:600 22px/1 Inter,system-ui;cursor:pointer}
#tasks .tk-list .task-quick-button:hover{background:var(--panel2);color:var(--ink)}
#tasks .task-quick-button:focus-visible{outline:2px solid var(--green-fill);outline-offset:-3px}
.task-workflow-dialog{box-sizing:border-box;width:min(520px,calc(100% - 24px));max-height:85dvh;padding:0;border:1px solid var(--line);border-radius:var(--r-lg);background:var(--panel);color:var(--ink);font:400 14px/1.5 Inter,system-ui,sans-serif}
.task-workflow-dialog::backdrop{background:rgba(0,0,0,.48)}
.task-workflow-dialog>header{display:flex;gap:12px;align-items:center;justify-content:space-between;padding:14px 18px;border-bottom:1px solid var(--line)}
.task-workflow-dialog h2{font:600 18px/1.4 Inter,system-ui,sans-serif;margin:0}
.task-workflow-body{padding:18px;overflow:auto}
.task-workflow-dialog label{display:flex;flex-direction:column;gap:5px;margin-bottom:12px;font-size:13px}
.task-workflow-dialog input,.task-workflow-dialog select{box-sizing:border-box;min-width:0;width:100%;min-height:44px;padding:8px 10px;border:1px solid var(--line);border-radius:var(--r-sm);color:var(--ink);background:var(--panel2);font:inherit}
.task-workflow-dialog .btn{min-height:44px;font:inherit}
.task-workflow-dialog footer{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:16px}
.task-quick-title{margin:0 0 16px;overflow-wrap:anywhere;font-weight:600}
.task-workflow-error{color:var(--overdue);margin:0;overflow-wrap:anywhere}
.task-review-list article{padding:14px 0;border-top:1px solid var(--line);overflow-wrap:anywhere}
.task-review-list article>div{display:flex;gap:8px;flex-wrap:wrap}
#users .dza-seg{flex-wrap:wrap}
@media(max-width:700px){
 #tasks .tk-list td:nth-child(2){padding-right:44px!important}
 #tasks .tk-list .task-quick-button{width:44px;height:44px;top:0;right:0;transform:none}
 .task-workflow-dialog{max-height:90dvh}
}
#tasks .tk-list .task-quick-button{display:grid;place-items:center}
dialog.task-workflow-dialog[open]{position:fixed;inset:0;margin:auto}
@media(max-width:700px){
 html[data-lab-v="2"] #users.dza #dzaSeg.dza-seg{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;overflow:visible!important}
 html[data-lab-v="2"] #users.dza .dza-t tr.dza-click{grid-template-columns:minmax(0,1fr)}
 html[data-lab-v="2"] #users.dza .dza-t td.dza-act-c{grid-column:1/-1;grid-row:3;width:auto;text-align:left}
 html[data-lab-v="2"] #users.dza .dza-act{max-width:none;justify-content:flex-start;gap:6px}
}
@media(max-width:700px){
 html[data-lab-v="2"] #users.dza #dzaSeg.dza-seg{border-radius:var(--r-lg)!important}
 html[data-lab-v="2"] #users.dza #dzaSeg.dza-seg::after{display:none!important;content:none!important}
 html[data-lab-v="2"] #users.dza #dzaSeg.dza-seg>button{border-radius:var(--r-sm)!important}
}
html[data-lab-v="2"] #users.dza #dzaSeg.dza-seg>button i{opacity:1!important}

/* List identity remains colored; edit belongs at the right edge, not below the title. */
#tasks .tk-list .task-kind-icon{color:var(--ink-blue)}
#tasks .tk-list .task-kind-icon.tkt-low{color:var(--ink-blue)}
#tasks .tk-list .task-kind-icon.tkt-normal{color:var(--ink-orange)}
#tasks .tk-list .task-kind-icon.tkt-urgent,#tasks .tk-list .task-kind-icon.task-urgency-overdue{color:var(--overdue)}
#tasks .tk-list .task-kind-icon.tkt-plan{color:var(--muted)}
#tasks .tk-list .task-kind-icon.task-urgency-today{color:var(--ink-orange)}
#tasks .tk-list .task-quick-button svg{display:block;width:18px;height:18px;stroke:currentColor}
#tasks .tk-list .task-row-meta:empty{display:none}

@media(max-width:700px){#tasks .tk-list.task-list-mine td:nth-child(4),#tasks .tk-list td.task-no-client{display:none!important}}

@media(max-width:700px){#clientbase .dz2p-touch-empty{display:none!important}}
