body.mttp-active .content-area {
  background:
    linear-gradient(180deg, rgba(247, 250, 253, 0.92), rgba(241, 245, 249, 0.96)),
    linear-gradient(120deg, rgba(24, 92, 154, 0.08), rgba(10, 128, 119, 0.08));
}

body.mttp-active .content-area > .master-page.module-task-templates {
  display: none !important;
}

#mttp-root {
  color: #0f1f33;
}

.mttp-page {
  display: grid;
  gap: 16px;
  min-height: calc(100vh - 48px);
}

.mttp-header {
  align-items: center;
  background: #ffffff;
  border: 1px solid #d8e2ef;
  border-radius: 10px;
  box-shadow: 0 20px 42px -32px rgba(15, 31, 51, 0.48);
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  padding: 16px 18px;
  position: relative;
}

.mttp-header::before {
  background: linear-gradient(90deg, #245aa0, #0f766e, #78a846);
  border-radius: 10px 10px 0 0;
  content: "";
  height: 4px;
  inset: 0 0 auto;
  position: absolute;
}

.mttp-title {
  align-items: center;
  display: flex;
  gap: 12px;
  min-width: 0;
}

.mttp-title a {
  align-items: center;
  background: #eef7f4;
  border: 1px solid #c8e2da;
  border-radius: 8px;
  color: #0f766e;
  display: inline-flex;
  font-size: 13px;
  font-weight: 750;
  min-height: 36px;
  padding: 0 12px;
  text-decoration: none;
}

.mttp-title h1 {
  font-size: 28px;
  line-height: 1.05;
  margin: 0;
}

.mttp-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.mttp-stat {
  border: 1px solid #d7e2ef;
  border-radius: 9px;
  display: grid;
  min-width: 96px;
  padding: 8px 11px;
}

.mttp-stat strong {
  font-size: 21px;
  line-height: 1;
}

.mttp-stat small {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  margin-top: 4px;
  text-transform: uppercase;
}

.mttp-blue {
  background: #f1f6ff;
  color: #184d8f;
}

.mttp-green {
  background: #eef9f5;
  color: #0e675e;
}

.mttp-amber {
  background: #fff8ec;
  color: #9a6217;
}

.mttp-slate {
  background: #f7f9fc;
  color: #3c526d;
}

.mttp-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.mttp-page button {
  border: 1px solid #184d8f;
  border-radius: 8px;
  box-shadow: none;
  min-height: 36px;
  padding: 8px 12px;
}

.mttp-page button:not(.mttp-secondary) {
  background: #1f5d9d;
  color: #ffffff;
}

.mttp-page button:disabled {
  opacity: .55;
}

.mttp-secondary,
.mttp-drawer-head button,
.mttp-checklist li button {
  background: #ffffff !important;
  border-color: #cad8ea !important;
  color: #213a5d !important;
}

.mttp-alert {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 9px;
  color: #9f1239;
  font-weight: 650;
  padding: 10px 12px;
}

.mttp-workspace {
  align-items: stretch;
  display: grid;
  gap: 14px;
  grid-template-columns: 274px minmax(300px, 1fr) minmax(330px, 420px);
  min-height: 600px;
}

.mttp-panel {
  background: #ffffff;
  border: 1px solid #d8e2ef;
  border-radius: 10px;
  box-shadow: 0 18px 42px -34px rgba(15, 31, 51, 0.5);
  min-width: 0;
  overflow: hidden;
}

.mttp-panel-head,
.mttp-detail-head,
.mttp-checklist-head {
  align-items: center;
  border-bottom: 1px solid #e3eaf3;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 14px;
}

.mttp-panel-head {
  align-items: stretch;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  flex-direction: column;
}

.mttp-panel h2,
.mttp-detail h2 {
  font-size: 18px;
  line-height: 1.15;
  margin: 0;
}

.mttp-panel-head p,
.mttp-kicker {
  color: #66758b;
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin: 3px 0 0;
  text-transform: uppercase;
}

.mttp-mini-metrics {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mttp-mini-metrics span {
  align-items: baseline;
  background: #f7f9fc;
  border: 1px solid #e1e8f2;
  border-radius: 8px;
  color: #65748a;
  display: flex;
  font-size: 12px;
  font-weight: 750;
  gap: 5px;
  min-height: 34px;
  padding: 7px 9px;
}

.mttp-mini-metrics strong {
  color: #102033;
  font-size: 16px;
}

.mttp-panel input,
.mttp-form input,
.mttp-form select,
.mttp-form textarea {
  background: #ffffff;
  border: 1px solid #cbd8ea;
  border-radius: 8px;
  color: #102033;
  min-height: 38px;
  padding: 9px 11px;
}

.mttp-list,
.mttp-task-list {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 250px);
  overflow: auto;
  padding: 10px;
}

.mttp-dept,
.mttp-task {
  align-items: center;
  background: #ffffff !important;
  border: 1px solid transparent !important;
  color: #102033 !important;
  display: grid;
  gap: 10px;
  text-align: left;
}

.mttp-dept {
  grid-template-columns: 34px minmax(0, 1fr) auto;
  min-height: 58px;
  padding: 9px;
}

.mttp-task {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 68px;
  padding: 11px 12px;
}

.mttp-dept:hover,
.mttp-task:hover,
.mttp-dept.active,
.mttp-task.active {
  background: #f5f9ff !important;
  border-color: #b8cbe7 !important;
}

.mttp-dept.active,
.mttp-task.active {
  box-shadow: inset 3px 0 #245aa0;
}

.mttp-avatar {
  align-items: center;
  background: #e8f2ff;
  border-radius: 8px;
  color: #1f5d9d;
  display: inline-flex;
  font-weight: 800;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.mttp-dept-copy,
.mttp-task span:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.mttp-dept strong,
.mttp-task strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mttp-dept small,
.mttp-task small {
  color: #63748c;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mttp-count,
.mttp-chip {
  border: 1px solid #d5e2f0;
  border-radius: 999px;
  color: #4c617a;
  font-size: 12px;
  font-weight: 750;
  padding: 4px 8px;
}

.mttp-chip.statutory {
  background: #fff7ed;
  border-color: #efd5af;
  color: #9a6217;
}

.mttp-detail {
  display: flex;
  flex-direction: column;
}

.mttp-detail-head {
  align-items: flex-start;
}

.mttp-detail-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 14px 14px 0;
}

.mttp-detail-grid span {
  background: #f7f9fc;
  border: 1px solid #e1e8f2;
  border-radius: 8px;
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
}

.mttp-detail-grid small {
  color: #66758b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.mttp-detail-grid strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mttp-description {
  color: #465a73;
  line-height: 1.45;
  margin: 12px 14px 0;
}

.mttp-checklist-head {
  border-top: 1px solid #e3eaf3;
  margin-top: 14px;
}

.mttp-checklist-head h3 {
  font-size: 15px;
  margin: 0;
}

.mttp-checklist {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  overflow: auto;
  padding: 12px 14px 16px;
}

.mttp-checklist.empty-list {
  display: block;
}

.mttp-checklist li {
  align-items: center;
  background: #fbfdff;
  border: 1px solid #e1e8f2;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: 30px minmax(0, 1fr) auto auto;
  padding: 9px;
}

.mttp-checklist li span {
  align-items: center;
  background: #e8f2ff;
  border-radius: 7px;
  color: #1f5d9d;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.mttp-checklist li strong {
  font-size: 13px;
}

.mttp-checklist li button {
  min-height: 30px;
  padding: 5px 8px;
}

.mttp-empty {
  align-items: center;
  border: 1px dashed #cfdbea;
  border-radius: 8px;
  color: #66758b;
  display: grid;
  font-weight: 650;
  min-height: 88px;
  padding: 16px;
  place-items: center;
  text-align: center;
}

.mttp-empty button {
  margin-top: 10px;
}

.mttp-empty.tall {
  margin: 14px;
  min-height: 220px;
}

.mttp-backdrop {
  background: rgba(10, 22, 40, 0.38);
  inset: 0;
  position: fixed;
  z-index: 90;
}

.mttp-drawer {
  background: #ffffff;
  border-left: 1px solid #d8e2ef;
  box-shadow: -28px 0 52px -34px rgba(10, 22, 40, 0.65);
  height: 100vh;
  overflow: auto;
  padding: 18px;
  position: fixed;
  right: 0;
  top: 0;
  width: min(480px, 94vw);
  z-index: 91;
}

.mttp-drawer-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}

.mttp-drawer-head h3 {
  font-size: 20px;
  margin: 0;
}

.mttp-form {
  display: grid;
  gap: 12px;
}

.mttp-form label {
  color: #213a5d;
  display: grid;
  font-size: 13px;
  font-weight: 750;
  gap: 6px;
}

.mttp-form textarea {
  resize: vertical;
}

.mttp-switch {
  align-items: center !important;
  display: flex !important;
  flex-direction: row !important;
}

.mttp-switch input {
  min-height: 0;
  width: 18px;
}

@media (max-width: 1240px) {
  .mttp-header {
    grid-template-columns: 1fr;
  }

  .mttp-stats,
  .mttp-actions {
    justify-content: flex-start;
  }

  .mttp-workspace {
    grid-template-columns: 260px minmax(320px, 1fr);
  }

  .mttp-detail {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .mttp-workspace {
    grid-template-columns: 1fr;
  }

  .mttp-title {
    align-items: flex-start;
    flex-direction: column;
  }
}
