/* Tasks: the notice counter in the menu and the mark of a task with something new in it. */
.nav-item .nav-badge {
  margin-left: auto; min-width: 20px; padding: 0 6px; box-sizing: border-box; border-radius: 10px;
  background: var(--color-unread-badge); color: var(--color-on-primary); font-size: 12px; font-weight: 600; line-height: 20px; text-align: center;
}
.nav-item .nav-badge[hidden] { display: none; }
.tasks-table .task-row--unread td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.tasks-table .task-row--unread .document-number-link { font-weight: 700; }
.tasks-table .status-button { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
#taskListPanel .tasks-table th { white-space: nowrap; }
.task-record-list { display: grid; gap: 12px; margin-top: 12px; }
.task-record-list .detail-box p { white-space: pre-wrap; overflow-wrap: anywhere; }

.task-history-toggle { margin-top: 4px; padding: 2px 8px; font-size: 12px; }
.task-history-changes > td { background: var(--color-surface-muted, #f5f7fa); }
:root[data-theme="dark"] .task-history-changes > td:not(.empty) {
  background-color: var(--color-surface-subtle);
}
:root[data-theme="dark"] .task-change-table tbody tr:nth-child(even) > td:not(.empty) {
  background-color: var(--color-surface-raised);
}
:root[data-theme="dark"] .task-history-toggle {
  background-color: var(--color-primary-soft);
  color: var(--color-text);
}
:root[data-theme="dark"] .task-history-toggle:is(:hover, :focus-visible) {
  background-color: var(--color-selection);
}

.task-change-table { width: 100%; }
.task-change-table th, .task-change-table td { text-align: left; vertical-align: top; white-space: pre-wrap; overflow-wrap: anywhere; }
.task-change-table { table-layout: fixed; }
.task-change-table th:first-child { width: 9rem; white-space: nowrap; }
/* The list of the tasks is as low as the other lists: the status chip is not a tall button. */
#taskListPanel .tasks-table .status-button { min-height: 0; height: auto; line-height: 1; }
/* Narrow columns shrink to their content (number, type, deadline, progress, status); the title takes what is left. */
#taskListPanel .tasks-table :is(th, td):is(:nth-child(1), :nth-child(3), :nth-child(7), :nth-child(8), :nth-child(9)) { width: 1%; }
#taskListPanel .tasks-table :is(th, td):nth-child(2) { width: 34%; min-width: 14rem; }
#taskListPanel .tasks-table td:nth-child(2) .document-person { max-width: 26rem; }
#taskListPanel .tasks-table .document-number-link { min-width: 0; width: auto; flex: none; }
#taskListPanel .tasks-table .status-button { padding: 0; border-radius: 0; }
#taskListPanel .tasks-table .status-button > .status { padding-inline: var(--task-status-padding-inline); }
#taskListPanel .tasks-table .status-button .sub { display: inline; margin-left: .4rem; }

:root[data-density="compact"] #taskListPanel .tasks-table :is(th, td):nth-child(2) { width: auto; min-width: 10rem; }
:root[data-density="compact"] #taskListPanel .tasks-table td:nth-child(2) .document-person { max-width: 11rem; }

/* The mobile table must not derive its minimum width from percentage-sized columns. */
@media (max-width: 880px) {
  #taskListPanel .tasks-table { min-width: 0; }
  #taskListPanel .tasks-table :is(th, td) { width: auto; }
  #taskListPanel .tasks-table :is(th, td):is(:nth-child(1), :nth-child(3), :nth-child(7), :nth-child(8), :nth-child(9)) { width: auto; }
  #taskListPanel .tasks-table :is(th, td):nth-child(2) { width: auto; min-width: 0; }
  :root[data-density="compact"] #taskListPanel .tasks-table :is(th, td):nth-child(2) { min-width: 0; }
  #taskListPanel .tasks-table td .document-person { max-width: 9rem; }
  #taskListPanel .tasks-table td:nth-child(2) .document-person { max-width: 13rem; }
}

/* Obsah zalozek navazuje na jejich spodni hranu stejne jako Detail. */
#taskEditorPanelRecords > #taskRecordForm,
#taskEditorPanelHistory {
  margin-top: 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

#taskEditorPanelRecords > #taskRecordForm,
#taskEditorPanelHistory {
  box-shadow: none !important;
}
