/* /opt/dashboard/public/css/tasks_modal.css */

#menu-tasks {
  position: relative;
}

#menu-tasks .tasks-menu-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  transform: translate(50%, -50%);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 750;
  line-height: 1;
  box-shadow: 0 0 0 2px rgba(20, 20, 24, 0.95);
  pointer-events: none;
}

#menu-tasks .tasks-menu-badge[hidden] {
  display: none;
}

#tasks-modal .tasks-modal {
  width: clamp(920px, calc(100vw - 32px), 1180px);
}

#tasks-modal .tasks-modal__header {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

#tasks-modal .tasks-modal__tabs {
  width: 330px;
  max-width: min(330px, calc(100vw - 112px));
}

#tasks-modal .tasks-modal__head-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

#tasks-modal .tasks-mine-toggle {
  height: 30px;
  min-width: 54px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(245, 245, 247, 0.86);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  cursor: pointer;
}

#tasks-modal .tasks-mine-toggle:hover {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.10);
}

#tasks-modal .tasks-mine-toggle.is-active,
#tasks-modal .tasks-mine-toggle[aria-pressed="true"] {
  border-color: rgba(10, 132, 255, 0.55);
  background: rgba(10, 132, 255, 0.22);
  color: #fff;
}

#tasks-modal .tasks-modal__body {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 320px;
  gap: 14px;
}

#tasks-modal .tasks-modal__side,
#tasks-modal .tasks-modal__main,
#tasks-modal .tasks-modal__details {
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.035);
  border-radius: 8px;
}

#tasks-modal .tasks-modal__side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
}

#tasks-modal .tasks-modal__main {
  display: flex;
  flex-direction: column;
  overflow: visible;
  position: relative;
  z-index: 2;
}

#tasks-modal .tasks-modal__details {
  display: flex;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

#tasks-modal .tasks-modal__field {
  display: grid;
  gap: 6px;
}

#tasks-modal .tasks-modal__title-input,
#tasks-modal .tasks-modal__note-input,
#tasks-modal .tasks-modal__date-input,
#tasks-modal .tasks-modal__select,
#tasks-modal .tasks-modal__toolbar .prices-modal-input {
  text-align: left;
}

#tasks-modal .tasks-modal__note-input {
  height: 96px;
  padding-top: 8px;
  resize: vertical;
  line-height: 1.35;
}

#tasks-modal .tasks-modal__add {
  width: 100%;
  background: var(--btn-bg);
  color: var(--btn-text);
  box-shadow: var(--btn-shadow);
}

#tasks-modal .tasks-modal__add:not(:disabled):not([aria-disabled="true"]) {
  background: var(--accent);
  color: var(--btn-primary-text);
}

#tasks-modal .tasks-modal__add:not(:disabled):not([aria-disabled="true"]):hover {
  background: var(--btn-primary-bg-hover);
  color: var(--btn-primary-text);
}

#tasks-modal .tasks-modal__add:disabled,
#tasks-modal .tasks-modal__add[aria-disabled="true"] {
  opacity: 1;
  cursor: not-allowed;
  background: var(--btn-bg);
  color: var(--btn-text);
  box-shadow: var(--btn-shadow);
  transform: none !important;
}

#tasks-modal .tasks-modal__toolbar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 142px 116px;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  position: relative;
  z-index: 5;
}

#tasks-modal .tasks-modal__search,
#tasks-modal .tasks-modal__period,
#tasks-modal .tasks-modal__priority {
  display: grid;
  gap: 6px;
}

#tasks-modal .tasks-modal__period .field-label {
  margin: 0;
  color: rgba(161, 161, 170, 0.75);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2px;
  line-height: 1.15;
  opacity: 1;
}

#tasks-modal .tasks-priority-drop,
#tasks-modal .tasks-assignee-drop {
  width: 100%;
}

#tasks-modal .tasks-modal__period .menudrop-btn,
#tasks-modal .tasks-modal__priority .menudrop-btn,
#tasks-modal .tasks-priority-drop .menudrop-btn,
#tasks-modal .tasks-assignee-drop .menudrop-btn {
  width: 100%;
}

#tasks-modal #tasks-priority-drop .menudrop-popover {
  left: auto;
  right: 0;
  min-width: 188px;
  width: 188px;
  transform-origin: calc(100% - 16px) 0;
}

#tasks-modal #tasks-new-assignee-drop .menudrop-item[data-value=""],
#tasks-modal #tasks-new-priority-drop .menudrop-item[data-value=""] {
  display: none;
}

#tasks-modal #tasks-priority-drop .menudrop-btn[data-filter-active="1"] {
  border-color: rgba(10, 132, 255, 0.35);
  background-color: rgba(10, 132, 255, 0.16);
}

#tasks-modal #tasks-priority-drop .menudrop-btn[data-filter-active="1"]:hover {
  border-color: rgba(10, 132, 255, 0.45);
  background-color: rgba(10, 132, 255, 0.22);
}

#tasks-modal .tasks-modal__list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 12px;
  display: grid;
  grid-auto-rows: max-content;
  gap: 8px;
  align-content: start;
}

#tasks-modal .tasks-empty {
  min-height: 320px;
  display: grid;
  place-content: center;
  gap: 6px;
  text-align: center;
  color: var(--text-muted);
}

#tasks-modal .tasks-empty__title {
  color: var(--text-main);
  font-size: 15px;
  font-weight: 650;
}

#tasks-modal .tasks-empty__text {
  max-width: 360px;
  font-size: 12px;
  line-height: 1.45;
}

#tasks-modal .tasks-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  min-height: 0;
  padding: 10px 12px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
}

#tasks-modal .tasks-card.is-selected {
  border-color: rgba(10, 132, 255, 0.45);
  background: rgba(10, 132, 255, 0.12);
}

#tasks-modal .tasks-card--high {
  border-color: rgba(255, 69, 58, 0.38);
  background: rgba(255, 69, 58, 0.08);
}

#tasks-modal .tasks-card--low {
  opacity: 0.82;
}

#tasks-modal .tasks-card__main {
  grid-column: 1 / -1;
  min-width: 0;
  padding-right: 0;
}

#tasks-modal .tasks-card__title {
  appearance: none;
  display: inline-block;
  width: fit-content;
  max-width: calc(100% - 170px);
  min-height: 17px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-main);
  text-align: left;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.3;
  cursor: text;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#tasks-modal .tasks-card__note {
  appearance: none;
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  text-align: left;
  font: inherit;
  font-size: 12px;
  line-height: 1.35;
  cursor: text;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#tasks-modal .tasks-card__note.is-empty {
  color: rgba(161, 161, 170, 0.72);
}

#tasks-modal .tasks-card__title:not(button),
#tasks-modal .tasks-card__note:not(button),
#tasks-modal .tasks-card__due:not(button) {
  cursor: pointer;
}

#tasks-modal .tasks-card__title-input,
#tasks-modal .tasks-card__note-input,
#tasks-modal .tasks-card__due-input {
  width: 100%;
  text-align: left;
}

#tasks-modal .tasks-card__title-input {
  min-height: 40px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.3;
  resize: vertical;
}

#tasks-modal .tasks-card__note-input {
  min-height: 72px;
  margin-top: 4px;
  line-height: 1.35;
  resize: vertical;
}

#tasks-modal .tasks-card__due-input {
  max-width: 160px;
  margin-top: 8px;
}

#tasks-modal .tasks-card__meta {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 160px;
  justify-content: flex-end;
  color: rgba(161, 161, 170, 0.9);
  font-size: 11px;
}

#tasks-modal .tasks-card__due {
  appearance: none;
  display: block;
  width: auto;
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(245, 245, 247, 0.88);
  text-align: left;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
  cursor: text;
}

#tasks-modal .tasks-card__due:not(button) {
  cursor: pointer;
}

#tasks-modal .tasks-card__footer {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-top: 0;
  min-width: 0;
  min-height: 20px;
}

#tasks-modal .tasks-card__created {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  color: rgba(161, 161, 170, 0.72);
  font-size: 11px;
  line-height: 1.2;
}

#tasks-modal .tasks-card__created span {
  min-width: 0;
  overflow-wrap: anywhere;
}

#tasks-modal .tasks-card__created span + span::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 3px;
  margin: 0 8px 2px 0;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
}

#tasks-modal .tasks-card__assignee {
  margin-top: 5px;
  color: rgba(161, 161, 170, 0.78);
  font-size: 11px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

#tasks-modal .tasks-card__assignee-email {
  appearance: none;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(245, 245, 247, 0.92);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
}

#tasks-modal .tasks-card__assignee-email:hover,
#tasks-modal .tasks-card__assignee-email:focus-visible,
#tasks-modal .tasks-card__assignee-email.is-open {
  outline: none;
  color: rgba(245, 245, 247, 1);
}

#tasks-modal b.tasks-card__assignee-email {
  cursor: pointer;
}

#tasks-modal .tasks-card__assignee-drop {
  display: inline-block;
  max-width: 100%;
  vertical-align: top;
}

#tasks-modal .tasks-card__assignee-drop .menudrop-popover {
  left: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  max-width: min(320px, calc(100vw - 48px));
  max-height: 220px;
  padding: 6px;
  border-radius: 12px;
  z-index: 260;
}

#tasks-modal .tasks-card__assignee-drop .menudrop-item {
  min-height: 26px;
  padding: 4px 10px 4px 34px;
  font-size: 13px;
  line-height: 16px;
}

#tasks-modal .tasks-card__assignee-empty {
  padding: 8px 10px;
  color: rgba(161, 161, 170, 0.86);
  font-size: 12px;
}

#tasks-modal .tasks-card__meta span {
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.065);
}

#tasks-modal .tasks-card__actions {
  justify-self: end;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: default;
}

#tasks-modal .tasks-card__btn {
  flex: 0 0 auto;
}

#tasks-modal .tasks-card__btn svg {
  width: 16px;
  height: 16px;
}

#tasks-modal .tasks-card__btn[data-action="change-task-status"][data-next-status="done"],
#hypotheses-modal .hypotheses-card__btn[data-action="change-hypothesis-status"][data-next-status="done"] {
  width: 26px;
  height: 26px;
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  opacity: 1;
  box-sizing: border-box;
}

#tasks-modal .tasks-card__btn[data-action="change-task-status"][data-next-status="done"]:hover,
#hypotheses-modal .hypotheses-card__btn[data-action="change-hypothesis-status"][data-next-status="done"]:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.10);
}

#tasks-modal .tasks-card__btn--danger {
  color: rgba(255, 105, 97, 0.95);
}

#tasks-modal .tasks-details,
#tasks-modal .tasks-details-empty,
#hypotheses-modal .tasks-details,
#hypotheses-modal .tasks-details-empty {
  width: 100%;
  min-width: 0;
}

#tasks-modal .tasks-details,
#hypotheses-modal .tasks-details {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

#tasks-modal .tasks-details-empty,
#hypotheses-modal .tasks-details-empty {
  display: grid;
  place-content: center;
  gap: 6px;
  text-align: center;
  color: var(--text-muted);
}

#tasks-modal .tasks-details-empty__title,
#hypotheses-modal .tasks-details-empty__title {
  color: var(--text-main);
  font-size: 14px;
  font-weight: 650;
}

#tasks-modal .tasks-details-empty__text,
#hypotheses-modal .tasks-details-empty__text {
  font-size: 12px;
}

#tasks-modal .tasks-comments,
#hypotheses-modal .tasks-comments {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 12px;
  display: grid;
  gap: 8px;
  align-content: start;
}

#tasks-modal .tasks-comments-empty,
#hypotheses-modal .tasks-comments-empty {
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
  padding: 28px 8px;
}

#tasks-modal .tasks-comment,
#hypotheses-modal .tasks-comment {
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

#tasks-modal .tasks-comment__head,
#hypotheses-modal .tasks-comment__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: rgba(161, 161, 170, 0.78);
  font-size: 11px;
  line-height: 1.2;
}

#tasks-modal .tasks-comment__meta,
#tasks-modal .tasks-comment__actions,
#hypotheses-modal .tasks-comment__meta,
#hypotheses-modal .tasks-comment__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

#tasks-modal .tasks-comment__meta,
#hypotheses-modal .tasks-comment__meta {
  flex: 1 1 auto;
  overflow: hidden;
}

#tasks-modal .tasks-comment__meta span,
#hypotheses-modal .tasks-comment__meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#tasks-modal .tasks-comment__actions,
#hypotheses-modal .tasks-comment__actions {
  flex: 0 0 auto;
}

#tasks-modal .tasks-comment__btn--danger,
#hypotheses-modal .tasks-comment__btn--danger {
  color: rgba(255, 105, 97, 0.95);
}

#tasks-modal .tasks-comment__text,
#hypotheses-modal .tasks-comment__text {
  margin-top: 6px;
  color: var(--text-main);
  font-size: 12px;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#tasks-modal .tasks-comment-edit,
#hypotheses-modal .tasks-comment-edit {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

#tasks-modal .tasks-comment-edit__input,
#hypotheses-modal .tasks-comment-edit__input {
  min-height: 88px;
  resize: vertical;
  text-align: left;
  font-size: 12px;
  line-height: 1.35;
}

#tasks-modal .tasks-comment-edit__actions,
#hypotheses-modal .tasks-comment-edit__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

#tasks-modal .tasks-comment-form,
#hypotheses-modal .tasks-comment-form {
  flex: 0 0 auto;
  display: grid;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
}

#tasks-modal .tasks-comment-form__input,
#hypotheses-modal .tasks-comment-form__input {
  height: 88px;
  padding-top: 8px;
  resize: vertical;
  text-align: left;
  line-height: 1.35;
}

#tasks-modal .tasks-comment-form__save,
#hypotheses-modal .tasks-comment-form__save {
  justify-self: end;
  min-width: 120px;
}

#tasks-modal .tasks-comment-form__save:not(:disabled):not([aria-disabled="true"]),
#hypotheses-modal .tasks-comment-form__save:not(:disabled):not([aria-disabled="true"]) {
  background: var(--accent);
  color: var(--btn-primary-text);
}

#hypotheses-modal .tasks-comment-form__save:disabled,
#tasks-modal .tasks-comment-form__save:disabled,
#tasks-modal .tasks-comment-form__save[aria-disabled="true"],
#hypotheses-modal .tasks-comment-form__save[aria-disabled="true"] {
  opacity: 1;
  cursor: not-allowed;
  background: var(--btn-bg);
  color: var(--btn-text);
  box-shadow: var(--btn-shadow);
  transform: none !important;
}

@media (max-width: 760px) {
  #tasks-modal .tasks-modal__body {
    grid-template-columns: minmax(0, 1fr);
  }

  #tasks-modal .tasks-modal__toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  #tasks-modal .tasks-card {
    grid-template-columns: minmax(0, 1fr);
  }

  #tasks-modal .tasks-card__actions {
    justify-content: flex-end;
  }
}
