.complaint {
  grid-template-columns: 8px minmax(0, 1fr) 132px 72px;
}

.complaint-summary {
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.complaint-summary:hover h4,
.complaint-summary:focus-visible h4 {
  color: var(--green);
}

.complaint-summary:focus-visible {
  border-radius: 4px;
  outline: 2px solid #8ecabd;
  outline-offset: 3px;
}

.complaint-meta {
  display: grid;
  justify-items: start;
  gap: 5px;
}

.complaint-meta time {
  margin: 0;
}

.priority-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 11px;
  padding: 4px 8px;
  font-size: 10px;
  line-height: 1.2;
}

.priority-rendah {
  background: #edf3f1;
  color: #58716c;
}

.priority-sedang {
  background: #fff3db;
  color: #9a641c;
}

.priority-tinggi,
.priority-sangat_tinggi {
  background: #fde9e5;
  color: #b44232;
}

.complaint-manage {
  border: 1px solid #b5d8ca;
  border-radius: 5px;
  background: #fff;
  color: var(--green);
  padding: 7px 9px;
  font: 600 10px inherit;
  cursor: pointer;
}

#complaint-detail-modal {
  width: min(920px, calc(100% - 30px));
  max-height: calc(100vh - 30px);
  overflow: auto;
}

.complaint-detail-shell {
  padding: 24px;
}

.complaint-detail-heading {
  position: sticky;
  z-index: 3;
  top: -24px;
  margin: -24px -24px 0;
  padding: 24px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.detail-loading,
.detail-error {
  margin: 0;
  padding: 44px 12px;
  color: var(--muted);
  text-align: center;
}

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  margin: 22px 0;
}

.workflow-step {
  position: relative;
  padding-top: 22px;
  color: #91a09d;
  font-size: 9px;
  text-align: center;
}

.workflow-step::before {
  position: absolute;
  z-index: 1;
  top: 4px;
  left: calc(50% - 6px);
  width: 12px;
  height: 12px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #d9e2df;
  box-shadow: 0 0 0 1px #d9e2df;
  content: "";
}

.workflow-step::after {
  position: absolute;
  top: 9px;
  right: 50%;
  width: 100%;
  height: 2px;
  background: #d9e2df;
  content: "";
}

.workflow-step:first-child::after {
  display: none;
}

.workflow-step.complete,
.workflow-step.current {
  color: var(--green);
  font-weight: 700;
}

.workflow-step.complete::before,
.workflow-step.current::before,
.workflow-step.complete::after,
.workflow-step.current::after {
  background: var(--green);
  box-shadow: 0 0 0 1px var(--green);
}

.complaint-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
  gap: 18px;
}

.complaint-copy h3,
.detail-section h3,
.workflow-editor h3 {
  margin: 0 0 10px;
  font: 700 14px "Plus Jakarta Sans";
}

.complaint-copy p {
  margin: 0 0 15px;
  color: #405b60;
  line-height: 1.65;
  white-space: pre-wrap;
}

.detail-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  margin: 0 0 18px;
}

.detail-facts div {
  min-width: 0;
}

.detail-facts dt {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.detail-facts dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  font-size: 11px;
  font-weight: 600;
}

.analysis-panel {
  align-self: start;
  border-left: 4px solid var(--teal);
  border-radius: 6px;
  background: #eef8f4;
  padding: 16px;
}

.analysis-score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.analysis-score strong {
  font: 800 26px "Plus Jakarta Sans";
}

.analysis-panel h3 {
  margin: 0 0 9px;
  font: 700 13px "Plus Jakarta Sans";
}

.analysis-panel ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 17px;
  color: #4b6862;
  font-size: 10px;
  line-height: 1.45;
}

.analysis-decision {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.detail-section,
.workflow-editor {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.attachment-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.detail-attachment {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.detail-attachment img,
.detail-attachment video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #edf2ef;
}

.detail-attachment div {
  padding: 8px 9px;
}

.detail-attachment strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 10px;
}

.detail-attachment a,
.detail-attachment small {
  display: inline-block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.detail-attachment a {
  margin-left: 7px;
  color: var(--green);
  font-weight: 700;
}

.history-list {
  display: grid;
  gap: 0;
}

.history-item {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  gap: 10px;
  border-top: 1px solid #edf1ef;
  padding: 11px 0;
}

.history-item:first-child {
  border-top: 0;
}

.history-dot {
  width: 9px;
  height: 9px;
  margin-top: 3px;
  border-radius: 50%;
  background: var(--teal);
}

.history-item strong,
.history-item p,
.history-item time {
  font-size: 10px;
}

.history-item p {
  margin: 3px 0 0;
  color: #557075;
}

.history-item time {
  color: var(--muted);
}

.workflow-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.workflow-form .workflow-note,
.workflow-actions {
  grid-column: 1 / -1;
}

.workflow-form select,
.workflow-form textarea {
  width: 100%;
}

.workflow-field {
  display: grid;
  align-content: start;
  gap: 5px;
}

.workflow-field .text-button {
  justify-self: start;
  padding: 0;
  font-size: 9px;
}

.workflow-form textarea {
  width: 100%;
  min-height: 86px;
}

.workflow-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.danger-button {
  margin-right: auto;
  border: 1px solid #dca49d;
  border-radius: 6px;
  background: #fff;
  color: #ad4033;
  padding: 10px 14px;
  font: 600 12px inherit;
  cursor: pointer;
}

.detail-empty {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.map-link {
  color: var(--green);
  white-space: nowrap;
}

@media (max-width: 760px) {
  .complaint-detail-grid,
  .workflow-form {
    grid-template-columns: 1fr;
  }

  .workflow-form .workflow-note,
  .workflow-actions {
    grid-column: auto;
  }

  .attachment-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .complaint {
    grid-template-columns: 8px minmax(0, 1fr) 66px;
  }

  .complaint-meta {
    grid-column: 2;
  }

  .complaint-manage {
    grid-column: 3;
    grid-row: 1 / span 2;
  }
}

@media (max-width: 520px) {
  .complaint-detail-shell {
    padding: 18px;
  }

  .complaint-detail-heading {
    top: -18px;
    margin: -18px -18px 0;
    padding: 18px;
  }

  .workflow-steps {
    grid-template-columns: repeat(3, 1fr);
    row-gap: 10px;
  }

  .workflow-step:nth-child(4)::after {
    display: none;
  }

  .detail-facts,
  .attachment-gallery {
    grid-template-columns: 1fr;
  }

  .workflow-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .workflow-actions button {
    width: 100%;
  }

  .danger-button {
    margin-right: 0;
  }
}
