/* tasks.css — supplements components.css + Tailwind for the Tasks grid.
   Most layout/styling comes from Tailwind classes on the markup. This
   file holds only small overrides specific to the dynamic rows. */

/* Material icons used by the mock */
.mi { font-family: "Material Icons"; font-style: normal; line-height: 1; }
.mi-16 { font-size: 16px; }
.mi-18 { font-size: 18px; }

/* Scrollbar — keep matching the mock's thin scrollbar */
.scrollbar-thin::-webkit-scrollbar { width: 8px; height: 8px; }
.scrollbar-thin::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 4px; }
.scrollbar-thin::-webkit-scrollbar-track { background: transparent; }

/* Sr-only utility for the hidden checkbox behind the Show Resolved toggle */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Modal foundation shared by the task detail and the embedded form. */
body.task-modal-open {
  overflow: hidden;
}

.task-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.task-modal.hidden {
  display: none;
}

.task-modal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.74);
}

.task-modal__panel {
  position: relative;
  z-index: 1;
  width: min(1164px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.32);
  outline: none;
}

.task-detail {
  min-height: min(94vh, 980px);
}

.task-detail__head,
.task-form-modal__head {
  min-height: 64px;
  padding: 0 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #e5e7eb;
}

.task-detail__head h2 {
  margin: 0;
  color: #1f2937;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
}

.task-detail__head-actions,
.task-form-modal__actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.task-detail__close,
.task-form-modal__close {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #9ca3af;
  border: 0;
  border-radius: 999px;
  background: transparent;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.task-detail__close:hover,
.task-form-modal__close:hover {
  color: #1f2937;
  background: #f3f4f6;
}

.task-detail__body {
  flex: 1;
  min-height: 0;
  padding: 24px 38px 0;
  overflow: auto;
}

.task-detail__body::-webkit-scrollbar {
  width: 10px;
}

.task-detail__body::-webkit-scrollbar-thumb {
  background: #e5e7eb;
  border-radius: 999px;
  border: 3px solid #fff;
}

.task-detail__message {
  min-height: 164px;
  padding: 18px 24px;
  color: #374151;
  background: #f3f4f6;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
}

.task-detail__message-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.task-detail__sender {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
}

.task-detail__message-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 1px;
  color: #2563eb;
  border: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  white-space: nowrap;
}

.task-detail__message-link:hover {
  text-decoration: underline;
}

.task-detail__message-text {
  color: #374151;
  font-size: 16px;
  line-height: 24px;
}

.task-detail__message-text p {
  margin: 0 0 10px;
}

.task-detail__message-text p:last-child {
  margin-bottom: 0;
}

.task-detail__form {
  margin-top: 24px;
}

.task-detail__grid {
  display: grid;
  grid-template-columns: minmax(0, 477px) minmax(0, 452px);
  justify-content: center;
  column-gap: 66px;
  row-gap: 20px;
}

.task-detail__column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.td-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.td-field__label {
  min-height: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #374151;
  font-size: 14px;
  font-weight: 500;
  line-height: 18px;
}

.td-field__hint {
  padding: 2px 8px;
  color: #2563eb;
  background: #eff6ff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.td-field__control {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  color: #374151;
  background: #fff;
  border: 1px solid #aeaeae;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  font-size: 14px;
  font-weight: 500;
  line-height: 40px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.td-field__control::placeholder {
  color: #adaebc;
  font-weight: 400;
}

.td-field__control:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.td-field__control--select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 42px;
  background-image: none;
}

.td-field__control--muted {
  color: #6b7280;
  background: #f3f4f6;
  border-color: #e5e7eb;
}

.td-field__control--priority {
  color: #a78416;
  background: #ffecb3;
  border-color: #d1d5db;
  font-size: 16px;
  font-weight: 400;
}

.td-select-wrap,
.td-date-wrap {
  position: relative;
  display: block;
}

.td-select-wrap > .mi,
.td-date-wrap > .mi {
  position: absolute;
  right: 12px;
  top: 50%;
  color: #6b7280;
  pointer-events: none;
  transform: translateY(-50%);
}

.td-field__control--priority + .mi {
  color: #1f2937;
}

.task-detail__view-less {
  align-self: flex-end;
  height: 40px;
  margin: 2px 0 1px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: #2563eb;
  border: 0;
  background: transparent;
  font-size: 16px;
  font-weight: 400;
}

.task-reply {
  margin-top: 64px;
  border-radius: 10px;
}

.task-reply__toolbar {
  min-height: 56px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 2px solid #eeeff0;
  border-bottom-width: 1px;
  border-radius: 10px 10px 0 0;
  background: #fff;
}

.task-reply__tools,
.task-reply__menus {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.task-reply__tools button {
  width: 25px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #4b5563;
  border: 0;
  border-radius: 4px;
  background: transparent;
  font-size: 16px;
  font-weight: 700;
}

.task-reply__tools button:hover {
  background: #f3f4f6;
}

.task-reply__underline {
  text-decoration: underline;
}

.task-reply__select {
  width: 198px;
}

.task-reply__select:last-child {
  width: 252px;
}

.task-reply__editor {
  min-height: 302px;
  padding: 24px;
  color: #1f2937;
  background: #fff;
  border: 3px solid #eeeff0;
  border-top: 0;
  border-radius: 0 0 11px 11px;
  font-size: 16px;
  line-height: 24px;
  outline: none;
  white-space: pre-wrap;
}

.task-reply__editor:focus {
  border-color: #bfdbfe;
  box-shadow: inset 0 0 0 1px #2563eb;
}

.task-detail__footer {
  min-height: 88px;
  padding: 18px 38px 28px;
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  background: #fff;
}

.task-detail__cancel,
.task-detail__primary {
  height: 40px;
  min-width: 82px;
  padding: 0 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
}

.task-detail__cancel {
  color: #06f;
  background: #fff;
  border: 1px solid #06f;
}

.task-detail__cancel:hover {
  background: #eff6ff;
}

.task-detail__primary {
  min-width: 174px;
  color: #fff;
  background: #37f;
  border: 1px solid #37f;
}

.task-detail__primary:hover {
  background: #2563eb;
}

.task-form-modal__panel {
  width: min(1220px, calc(100vw - 48px));
  height: min(900px, calc(100vh - 48px));
}

.task-form-modal__title {
  min-width: 0;
}

.task-form-modal__title h2 {
  margin: 0;
  color: #111827;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
}

.task-form-modal__title p {
  margin: 2px 0 0;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.25;
}

.task-form-modal__frame {
  flex: 1;
  width: 100%;
  min-height: 0;
  border: 0;
  background: #fff;
}

@media (max-width: 900px) {
  .task-modal {
    padding: 14px;
  }

  .task-modal__panel {
    width: calc(100vw - 28px);
    max-height: calc(100vh - 28px);
  }

  .task-detail__head,
  .task-form-modal__head {
    padding: 0 18px;
  }

  .task-detail__body {
    padding: 18px 18px 0;
  }

  .task-detail__grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .task-reply {
    margin-top: 34px;
  }

  .task-reply__toolbar,
  .task-reply__menus {
    align-items: stretch;
    flex-direction: column;
  }

  .task-reply__tools {
    flex-wrap: wrap;
  }

  .task-reply__select,
  .task-reply__select:last-child {
    width: 100%;
  }

  .task-detail__footer {
    padding: 14px 18px 18px;
  }
}
