/* Section: المهام (P6, on the API). The approved demo's tasks.css: the «عليّ» / «أتابعها مع غيري» tabs, the round
   check on task rows, the row subtitle, the done toggle, the 3-way status control and the comments. Colours come from
   the :root tokens in app.css only. */

/* ------------------------------------------------------------ tabs */

.task-tabs {
  margin: 0 0 12px;
}

.task-tabs .chips {
  flex-wrap: wrap;
}

.task-tabs .chip {
  min-height: 48px;
  padding-inline: 18px;
  font-size: 16px;
}

/* ------------------------------------------------------------ list rows */

.task-item {
  position: relative;
}

/* The space the check button covers: same size as the done mark, so titles line up in every group. */
.task-mark-space {
  display: block;
  width: 30px;
  height: 30px;
}

.task-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 2px solid var(--field-line);
  border-radius: 999px;
  background: var(--surface);
  color: transparent;
  transition: border-color 0.12s, color 0.12s, background-color 0.12s;
}

.task-mark .icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.6;
}

.task-mark-done {
  border-color: var(--ok);
  background: var(--ok);
  color: var(--surface);
}

/* A 52px tap target (var(--tap)) centred on the 30px space inside the row: 4px border + 16px padding + 15px − 26px. */
.task-check {
  position: absolute;
  top: 50%;
  inset-inline-start: calc(35px - var(--tap) / 2);
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  transform: translateY(-50%);
  cursor: pointer;
}

.task-check:hover .task-mark,
.task-check:focus-visible .task-mark {
  border-color: var(--ok);
  color: var(--ok);
}

.task-check:active .task-mark {
  border-color: var(--ok);
  background: var(--ok);
  color: var(--surface);
}

.task-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 12px;
  row-gap: 2px;
}

.task-context,
.task-when {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.task-context {
  min-width: 0;
  overflow-wrap: anywhere;
}

.task-who {
  color: var(--text);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.task-when {
  white-space: nowrap;
}

.task-context .icon svg,
.task-when .icon svg {
  width: 15px;
  height: 15px;
}

.task-when-late {
  color: var(--late);
  font-weight: 700;
}

.task-when-today {
  color: var(--soon);
  font-weight: 700;
}

.task-done-toggle {
  margin: 20px 0 0;
}

.task-done-toggle .btn {
  min-height: 46px;
}

/* ------------------------------------------------------------ detail */

.task-status-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}

.task-status {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.task-status .seg {
  padding-inline: 6px;
  font-size: 16px;
  line-height: 1.35;
}

.task-due-fact {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* Links in the facts: brand colour, underlined, with a taller tap area that does not move the layout. */
.task-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-block: -10px;
  padding-block: 10px;
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.task-link .icon svg {
  width: 17px;
  height: 17px;
}

.task-notes-title {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}

.task-notes {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.task-actions .task-delete {
  color: var(--late);
}

.task-actions .task-delete:hover:not(:disabled) {
  border-color: var(--late);
}

/* ------------------------------------------------------------ comments («التعليقات») */

.task-comments {
  margin-top: 22px;
}

.task-comment-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 12px;
}

.task-comment-input {
  flex: 1;
  min-height: 52px;
  resize: vertical;
}

.task-comment-bar .btn {
  flex-shrink: 0;
  min-height: 52px;
}

.task-comment-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-comment {
  padding: 10px 14px 12px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.task-comment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.task-comment-time {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.task-comment-tools {
  display: flex;
  margin-inline-end: -10px;
}

.task-comment-tools .icon-btn {
  width: 40px;
  height: 40px;
}

.task-comment-tools .icon-btn .icon svg {
  width: 20px;
  height: 20px;
}

.task-comment-text {
  margin: 2px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.7;
}
