/* Lists and tables: single source of truth */

:root {
  --list-table-header-bg: #f2f3f5;
  --list-table-border: #e9edf2;
  --list-table-row-bg: #f8f9fb;
  --list-table-row-hover: #f1f3f6;
  --list-table-heading: #313944;
  --list-table-text: #47515e;
  --list-table-text-muted: #5c6774;
  --list-table-text-empty: #a3acb7;
  --list-table-link: #4f5d6c;
  --list-table-link-hover: #37414d;
  --list-table-overdue: #c5483d;
  --list-table-overdue-soft: #f6e7e4;
  --list-table-pending: #2f8a4c;
  --list-table-pending-soft: #e8f4eb;
  --list-table-panel-bg: #fbf8f4;
  --list-table-add-btn-bg: #6f9253;
  --list-table-add-btn-bg-hover: #5f7f47;
  --list-table-add-btn-text: #ffffff;
  --list-table-dashboard-btn-bg: #e0e5eb;
  --list-table-dashboard-btn-bg-hover: #d4dbe3;
  --list-table-dashboard-btn-text: #44505d;
  --list-table-filter-bg-hover: #edf0f3;
  --list-table-filter-bg-active: #e1e6ec;
  --list-table-filter-text: #313944;
}

.task-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 16px;
  font-size: 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.task-table thead tr th:first-child {
  border-top-left-radius: 8px;
}

.task-table thead tr th:last-child {
  border-top-right-radius: 8px;
}

.task-table .cell-deadline {
  white-space: nowrap;
}

.task-table--today {
  margin-top: 0;
}

.task-table--today .today-task-cell,
.task-table--today .today-meeting-cell {
  font-size: 16px;
}

.task-table--today .today-task-main,
.task-table--today .today-meeting-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.task-table--today .today-task-main a,
.task-table--today .today-meeting-title a {
  white-space: normal;
  overflow-wrap: anywhere;
}

.task-table--today .today-task-time,
.task-table--today .today-meeting-time,
.task-table--today .today-meeting-duration,
.task-table--today .today-task-status,
.task-table--today .today-meeting-status,
.task-table--today .meeting-status-inline,
.today-tasks-header,
.task-table .field-label {
  color: var(--list-table-heading);
}

.task-table--today .today-task-time,
.task-table--today .today-meeting-time,
.task-table--today .today-meeting-duration {
  white-space: nowrap;
}

.task-table--today .today-meeting-duration {
  margin-left: 4px;
}

.today-tasks {
  margin-top: 0;
}

.today-tasks-header {
  font-size: 16px;
  font-weight: 600;
}

.task-table--today .today-tasks-total,
.today-tasks-mobile-heading .today-tasks-total {
  margin-left: 6px;
  color: var(--list-table-text-muted);
  font-size: 16px;
}

.today-tasks-mobile-heading {
  display: none;
  margin-bottom: 12px;
  color: var(--list-table-heading);
  font-weight: 600;
}

.today-tasks-mobile-heading .today-tasks-total {
  font-weight: 400;
}

.today-meetings {
  margin-bottom: 24px;
}

.task-table--today .today-task-title,
.meeting-status-inline,
.meeting-status-inline__meta {
  display: inline;
}

.task-table--today .today-task-empty {
  font-size: 16px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.today-tasks .reschedule-add {
  margin-top: 12px;
}

.today-projects {
  margin-top: 24px;
}

.today-tasks-modal .modal-body,
.today-tasks-form {
  display: flex;
  flex-direction: column;
}

.today-tasks-modal .modal-body {
  max-height: 70vh;
}

.today-tasks-form,
.today-tasks-list {
  flex: 1;
  min-height: 0;
}

.today-tasks-list {
  overflow-y: auto;
  padding-right: 14px;
}

.today-tasks-modal__search-field {
  margin-bottom: 12px;
}

.today-tasks-footer {
  position: sticky;
  bottom: 0;
  background: #fff;
  padding-top: 12px;
  margin-top: 12px;
}

.today-tasks-footer .modal-actions {
  margin-top: 12px;
}

.today-tasks-footer--compact {
  padding-top: 0;
  margin-top: 0;
}

.today-tasks-footer--compact .modal-actions {
  margin-top: 0;
}

.task-table th {
  text-align: left;
  font-weight: 400;
  background: var(--list-table-header-bg);
  color: var(--list-table-heading);
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--list-table-border);
  white-space: nowrap;
}

.task-table td {
  padding: 12px;
  border-bottom: 0;
  vertical-align: middle;
  background: var(--list-table-row-bg);
  color: var(--list-table-text);
  transition: background-color 0.16s ease;
}

.task-table tbody tr + tr td {
  border-top: 1px solid var(--list-table-border);
}

.task-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 8px;
}

.task-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 8px;
}

.task-table tbody tr:hover td,
.task-table tbody tr.overdue:hover td,
.task-table tbody tr.pending-confirmation:hover td,
.task-table tbody tr.archived:hover td,
.task-table tbody tr.completed-row:hover td {
  background: var(--list-table-row-hover);
}

.task-table tbody tr.overdue:hover td {
  background: var(--list-table-overdue-soft);
}

.task-table tbody tr.pending-confirmation:hover td {
  background: var(--list-table-pending-soft);
}

.task-table tbody tr.overdue td:first-child {
  box-shadow: inset 3px 0 0 var(--list-table-overdue);
}

.task-table tbody tr.pending-confirmation td:first-child {
  box-shadow: inset 3px 0 0 var(--list-table-pending);
}

.task-table tbody tr.overdue .meeting-status-inline,
.task-table tbody tr.overdue .today-task-status,
.task-table tbody tr.overdue .today-task-time,
.task-table tbody tr.overdue td[data-label="Deadline"],
.task-table tbody tr.overdue td[data-label="Дедлайн"] {
  color: var(--list-table-overdue);
}

.task-table tbody tr.pending-confirmation .meeting-status-inline,
.task-table tbody tr.pending-confirmation [data-meeting-status-label] {
  color: var(--list-table-pending);
}

.task-table td.status-nowrap {
  white-space: nowrap;
}

.task-table td.empty-mobile,
.task-table .table-empty-dash {
  color: var(--list-table-text-empty);
}

.task-table td a,
.task-table td a:visited,
.dashboard-section a:not(.form-add-btn):not(.btn),
.dashboard-section a:not(.form-add-btn):not(.btn):visited {
  color: var(--list-table-link);
}

.task-table td a:hover,
.task-table td a:focus-visible,
.dashboard-section a:not(.form-add-btn):not(.btn):hover,
.dashboard-section a:not(.form-add-btn):not(.btn):focus-visible {
  color: var(--list-table-link-hover);
}

.task-table .cell-clients .client-with-icon,
.client-link-wrap {
  display: inline;
  white-space: normal;
  vertical-align: baseline;
}

.client-link {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.client-link-wrap .client-satisfaction-icon {
  display: inline-block;
  white-space: nowrap;
  vertical-align: text-bottom;
}

.client-link-wrap .client-satisfaction-inline {
  display: inline;
  white-space: nowrap;
}

.task-table .cell-clients .client-with-icon::after,
.task-table .cell-clients .client-with-icon:last-child::after {
  content: "";
  margin-left: 0;
}

.task-table .cell-clients .client-with-icon .client-satisfaction-icon {
  display: inline-block;
  margin-left: 0;
  margin-right: 0 !important;
  vertical-align: text-bottom;
  text-decoration: none;
}

.task-table .cell-clients .client-with-icon .client-satisfaction-icon .s-icon {
  line-height: 0;
  transform: translateY(2px);
}

.task-table th .field-label {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  font-size: 14px;
  text-transform: none;
}

.task-table .filter-controls {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  margin-left: 2px;
  vertical-align: middle;
}

.task-table .filter-icon,
.task-table .filter-clear,
.task-table .cell-label-mobile .filter-icon,
.task-table .cell-label-mobile .filter-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  padding: 0;
  line-height: 1;
  cursor: pointer;
}

.task-table .filter-icon,
.task-table .cell-label-mobile .filter-icon {
  color: #88919b;
}

.task-table .filter-clear,
.task-table .cell-label-mobile .filter-clear {
  color: #c06767;
}

.task-table .filter-icon.active,
.task-table .cell-label-mobile .filter-icon.active {
  color: var(--list-table-pending);
}

.task-table .filter-icon svg,
.task-table .filter-clear svg {
  display: block;
  position: relative;
  top: 0;
}

.task-table .cell-label-mobile {
  display: none;
}

.task-table .cell-label-mobile .filter-controls {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  margin-left: 2px;
}

.task-table .cell-label-mobile .filter-icon svg,
.task-table .cell-label-mobile .filter-clear svg {
  display: block;
  position: relative;
  top: 3px;
}

.task-menu-cell {
  width: 1%;
  min-width: 56px;
  white-space: nowrap;
  text-align: right;
}

.task-menu-wrapper {
  position: relative;
  overflow: visible;
  display: flex;
  justify-content: flex-end;
}

.roadmap-detail-table .roadmap-category-row > td {
  background: transparent;
}

.roadmap-category-block > .roadmap-category-menu.task-menu-wrapper {
  position: absolute;
  right: 10px;
  top: var(--roadmap-category-header-center-y, 20px);
  transform: translateY(-50%);
  z-index: 4;
  display: block;
  width: auto;
  margin: 0;
}

.roadmap-category-block > .roadmap-category-menu.task-menu-wrapper .task-menu {
  z-index: 5;
}

.roadmap-category-block > .roadmap-category-menu.task-menu-wrapper .menu-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.pin-indicator {
  display: inline-block;
  flex: 0 0 auto;
  transform: translateY(1px);
  margin-right: 6px;
  vertical-align: middle;
  color: #bdbdbd;
}

.hidden {
  display: none;
}

.meeting-reschedule-indicator {
  display: inline-block;
  vertical-align: middle;
  line-height: 0;
  font-size: 0;
  color: gray;
}

.meeting-reschedule-indicator svg {
  display: block;
}

.task-menu .menu-popup > a,
.task-menu .menu-popup > button,
.task-menu .menu-popup > form > button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  line-height: 1.3;
  font-size: var(--list-size, 14px);
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  box-sizing: border-box;
  color: #111111;
  text-decoration: none;
}

.task-menu .menu-popup > a:visited,
.task-menu .menu-popup > a:hover,
.task-menu .menu-popup > a:focus,
.task-menu .menu-popup > a:focus-visible,
.task-menu .menu-popup > button,
.task-menu .menu-popup > button:hover,
.task-menu .menu-popup > button:focus,
.task-menu .menu-popup > button:focus-visible,
.task-menu .menu-popup > form > button,
.task-menu .menu-popup > form > button:hover,
.task-menu .menu-popup > form > button:focus,
.task-menu .menu-popup > form > button:focus-visible {
  color: #111111;
  text-decoration: none;
}

.task-menu .menu-popup > * + * {
  margin-top: 2px;
}

.task-menu .menu-popup > .menu-popup-gap {
  margin-top: 8px;
}

.task-menu .menu-popup > a:hover,
.task-menu .menu-popup > a:focus,
.task-menu .menu-popup > button:hover,
.task-menu .menu-popup > button:focus,
.task-menu .menu-popup > form > button:hover,
.task-menu .menu-popup > form > button:focus {
  background: var(--menu-hover-bg, #f5f5f7);
  color: #111111;
  outline: none;
}

.task-menu .menu-popup .danger {
  color: #111111;
}

.weekend {
  color: #8b0000;
}

a.completed,
a.completed:visited,
.completed {
  text-decoration: line-through;
  color: #666;
}

.dashboard-section + .dashboard-section {
  margin-top: 36px !important;
}

.dashboard-section--today {
  margin-bottom: 0;
}

.dashboard-section--today .form-add-btn,
.dashboard-section--today .form-add-btn:visited {
  background: var(--list-table-dashboard-btn-bg);
  border-color: transparent;
  color: var(--list-table-dashboard-btn-text);
}

.dashboard-section--today .form-add-btn .task-page-add-btn__icon {
  color: currentColor;
}

.dashboard-section--today .form-add-btn:hover,
.dashboard-section--today .form-add-btn:focus-visible {
  background: var(--list-table-dashboard-btn-bg-hover);
  border-color: transparent;
  color: var(--list-table-dashboard-btn-text);
  text-decoration: none;
}

.dashboard-alerts {
  display: flex;
  align-items: stretch;
  gap: 16px;
  margin-top: 24px;
}

.dashboard-alert-card,
.dashboard-panel-card {
  flex: 1 1 0;
  min-width: 0;
}

.dashboard-alert-card {
  display: flex;
  flex-direction: column;
}

.dashboard-panel,
.dashboard-alert {
  flex: 1 1 0;
  border: 0;
  border-radius: 8px;
  padding: 16px;
  color: var(--list-table-text);
  background: var(--list-table-panel-bg);
}

.dashboard-alert {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.dashboard-panel--stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dashboard-alert-title,
.dashboard-panel-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--list-table-heading);
}

.dashboard-alert-title--mobile,
.dashboard-panel-title--mobile {
  display: none;
}

.dashboard-alert-title {
  margin-bottom: 12px;
}

.dashboard-panel-title {
  margin: 0;
}

.dashboard-alert-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dashboard-alert-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  color: var(--list-table-text);
}

.dashboard-alert-item .muted,
.dashboard-panel .muted {
  color: var(--list-table-text-muted);
}

.dashboard-alert-indicator {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.dashboard-alert-indicator .client-memory-icon,
.dashboard-alert-indicator .client-satisfaction-icon {
  margin-left: 0;
}

.roadmap-status-filter {
  display: inline-flex;
  align-items: flex-start;
  gap: 4px;
  flex-wrap: wrap;
  background: #fff;
  border-radius: 999px;
  padding: 4px;
  max-width: 100%;
  scrollbar-width: none;
}

.roadmap-status-filter__button {
  border: 0;
  background: transparent;
  border-radius: 999px;
  color: #1f2937;
  font-size: 14px;
  line-height: 1.2;
  padding: 9px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  flex: 0 0 auto;
  min-height: 38px;
  box-sizing: border-box;
  overflow: visible;
}

.roadmap-status-filter__button:visited {
  color: #1f2937;
}

.list-count-indicator--filter-active {
  margin-left: 2px;
  font-size: 14px;
  line-height: 1;
}

.roadmap-status-filter__button:hover {
  background: var(--list-table-filter-bg-hover);
}

.roadmap-status-filter__button.is-active {
  background: var(--list-table-filter-bg-active);
  color: var(--list-table-filter-text);
}

.roadmap-status-filter__button.is-active:visited {
  color: var(--list-table-filter-text);
}

.roadmap-status-filter::-webkit-scrollbar {
  display: none;
}

.task-status-filter {
  margin-left: 12px;
}

.task-status-filter--mobile {
  display: none;
  margin: 6px 0 0;
}

.page-header-buttons .archive-link--mobile {
  display: inline-block;
}

.page-header-buttons .btn-success {
  border-color: var(--list-table-add-btn-bg);
  background-color: var(--list-table-add-btn-bg);
  color: var(--list-table-add-btn-text);
  border-radius: 999px;
}

.page-header-buttons a.btn.btn-success,
.page-header-buttons a.btn.btn-success:visited {
  color: var(--list-table-add-btn-text);
}

.page-header-buttons .btn-success:hover,
.page-header-buttons .btn-success:focus-visible {
  border-color: var(--list-table-add-btn-bg-hover);
  background-color: var(--list-table-add-btn-bg-hover);
  color: var(--list-table-add-btn-text);
}

@media (min-width: 969px) {
  .page-header-flex > .page-header-buttons {
    margin-left: 0;
    order: 3;
  }

  .page-header-flex > .list-search {
    order: 2;
    margin-left: auto;
  }

  .page-title-group .archive-link--desktop {
    display: inline-flex;
    align-items: center;
  }

  .page-header-buttons .archive-link--mobile,
  .page-header-flex--mobile-inline-controls .list-count-indicator--mobile-inline,
  .task-status-filter--mobile {
    display: none;
  }
}

@media (max-width: 968px) {
  .task-table thead {
    display: none;
  }

  .task-table,
  .task-table tbody,
  .task-table tr,
  .task-table td {
    display: block;
    width: 100%;
  }

  .task-table tr,
  .task-table tbody tr {
    margin-bottom: 12px;
    border: 0;
    border-radius: 8px;
    background: var(--list-table-row-bg);
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 8px;
    padding: 8px 10px;
  }

  .task-table tbody tr + tr {
    border-top: 0;
  }

  .task-table tbody tr + tr td,
  .task-table tbody tr td,
  .task-table tbody tr:nth-child(even) td,
  .task-table tbody tr:hover td,
  .task-table tbody tr.overdue td,
  .task-table tbody tr.pending-confirmation td,
  .task-table tbody tr.archived td,
  .task-table tbody tr.completed-row td,
  .task-table tbody tr.overdue:nth-child(even) td,
  .task-table tbody tr.pending-confirmation:nth-child(even) td,
  .task-table tbody tr.archived:nth-child(even) td,
  .task-table tbody tr.completed-row:nth-child(even) td,
  .task-table tbody tr.overdue:hover td,
  .task-table tbody tr.pending-confirmation:hover td,
  .task-table tbody tr.archived:hover td,
  .task-table tbody tr.completed-row:hover td {
    border-top: 0;
    background: transparent;
  }

  .task-table td {
    padding: 4px 0;
    border: none;
    width: auto;
  }

  .task-table td:not(.task-menu-cell) {
    grid-column: 1;
  }

  .task-table td.mobile-primary {
    padding-top: 0;
  }

  .task-table td:last-child:not(.task-menu-cell) {
    padding-bottom: 0;
  }

  .task-table td::before {
    content: attr(data-label);
    font-size: 14px;
    color: #777;
    text-transform: none;
    display: block;
    margin-bottom: 2px;
  }

  .task-table td.mobile-primary,
  .task-table td.mobile-primary a,
  .task-table .mobile-primary-time {
    font-weight: 600;
  }

  .task-table td.empty-mobile {
    display: none;
  }

  .task-table td.empty-mobile::before,
  .task-table td.cell-clients::before,
  .task-table td.cell-assignees::before,
  .task-table td.cell-projects::before {
    content: none;
  }

  .task-table td.cell-clients,
  .task-table td.cell-assignees,
  .task-table td.cell-projects {
    padding-top: 8px;
  }

  .task-table .cell-label-mobile {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 14px;
    color: #777;
    text-transform: none;
    margin-bottom: 4px;
  }

  .task-menu-cell {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    margin-top: 0;
    padding-top: 0;
    align-self: start;
    justify-self: end;
    transform: translateY(-2px);
  }

  .task-table--today td::before {
    content: none;
  }

  .task-table--today td.mobile-primary,
  .task-table--today td.mobile-primary a,
  .task-table--today .mobile-primary-time {
    font-weight: 400;
  }

  .task-table--today .today-task-cell {
    display: block;
  }

  .task-table--today tr.today-task-empty-row {
    display: block;
    padding: 8px 10px;
  }

  .task-table--today tr.today-task-empty-row .today-task-empty {
    padding: 4px 0;
  }

  .task-table tbody tr.overdue {
    border-left: 3px solid var(--list-table-overdue);
  }

  .task-table tbody tr.pending-confirmation {
    border-left: 3px solid var(--list-table-pending);
  }

  .task-table tbody tr.overdue td:first-child,
  .task-table tbody tr.pending-confirmation td:first-child {
    box-shadow: none;
  }

  .today-tasks-mobile-heading {
    display: block;
  }

  .dashboard-alerts {
    flex-direction: column;
    gap: 24px;
  }

  .dashboard-alert-card,
  .dashboard-panel-card {
    width: 100%;
  }

  .dashboard-alert-title--desktop,
  .dashboard-panel-title--desktop {
    display: none;
  }

  .dashboard-alert-title--mobile,
  .dashboard-panel-title--mobile {
    display: block;
    margin: 0 0 8px;
  }

  .dashboard-alert,
  .dashboard-panel--stats {
    padding: 8px 10px;
  }

  .dashboard-alert-list,
  .dashboard-panel--stats {
    gap: 0;
  }

  .dashboard-alert-item,
  .dashboard-panel--stats > .stats-filter,
  .dashboard-panel--stats > .stats-error,
  .dashboard-panel--stats > .stats-content {
    padding: 4px 0;
  }

  .dashboard-panel--stats > .stats-error {
    margin: 0;
  }

  .dashboard-panel--stats > .stats-content {
    min-width: 0;
  }

  .stats-list {
    gap: 4px;
  }

  .page-header-flex {
    flex-direction: column;
    align-items: stretch;
  }

  .page-header-buttons {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .page-header-buttons .btn {
    flex-grow: 0;
    width: auto;
  }

  .page-header-flex--mobile-inline-controls .page-header-buttons {
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 10px;
    margin-top: 6px;
  }

  .page-header-flex--mobile-inline-controls .page-header-primary-action {
    min-width: 0;
    gap: 10px;
    order: 1;
  }

  .page-header-flex--mobile-inline-controls .list-search {
    order: 2;
    margin-left: auto;
  }

  .page-header-flex--mobile-inline-controls .mobile-inline-list-header__context-menu {
    order: 3;
  }

  .page-header-flex--mobile-inline-controls .list-count-indicator--title {
    display: none;
  }

  .page-header-flex--mobile-inline-controls .page-title,
  .page-header-flex--mobile-inline-controls .page-title-group {
    padding-right: 0;
  }

  .meeting-list-results {
    margin-top: 6px;
  }

  .task-status-filter--desktop {
    display: none;
  }

  .task-status-filter--mobile {
    display: inline-flex;
  }

  .roadmap-detail-toolbar__actions.page-header-buttons {
    justify-content: flex-start !important;
  }

  .roadmap-category-block > .roadmap-category-menu.task-menu-wrapper {
    right: 2px;
    top: var(--roadmap-category-header-center-y, 20px);
  }
}
