#process-detail {
  width: min(920px, 95vw);
  max-height: 92vh;
  border-radius: 18px;
}

.process-detail-content {
  max-height: 92vh;
  overflow: auto;
  padding: 30px;
}

.process-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin: 20px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #e3e9ef;
}

.process-tabs button {
  border: 0;
  border-radius: 8px;
  padding: 10px 13px;
  background: transparent;
  color: #607188;
  font: 600 13px "DM Sans", sans-serif;
  white-space: nowrap;
  cursor: pointer;
}

.process-tabs button.active {
  background: #eaf2fb;
  color: #245f9e;
}

.process-tab-panel {
  display: none;
}

.process-tab-panel.active {
  display: block;
}

.process-tab-panel[data-process-panel="documents"].active {
  padding-top: 10px;
}

.process-tab-panel .document-button {
  display: inline-flex;
  align-items: center;
  width: auto;
  margin: 0;
  padding: 11px 16px;
  line-height: 1.2;
  cursor: pointer;
}

#document-list {
  clear: both;
  display: block;
  margin-top: 20px;
  padding-top: 4px;
}

#document-list .process-empty {
  margin: 0;
}

.process-detail-wide {
  grid-column: 1 / -1;
}

.process-detail-wide p {
  margin: 0;
  color: #536174;
  line-height: 1.55;
}

.process-notes-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.process-notes-heading h3 {
  margin: 0;
}

.process-notes-heading span {
  color: #748194;
  font-size: 11px;
}

.process-note-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 18px;
}

.process-note-form textarea {
  min-width: 0;
  resize: vertical;
  border: 1px solid #d6e0e9;
  border-radius: 9px;
  padding: 11px;
  color: #203247;
  font: 13px "DM Sans", sans-serif;
}

.process-note-form .activity-form-error {
  grid-column: 1 / -1;
}

.process-notes-list {
  display: grid;
  gap: 10px;
}

.process-notes-list article {
  padding: 12px 14px;
  border-left: 3px solid #3d78bd;
  border-radius: 7px;
  background: #f5f8fb;
}

.process-notes-list article p {
  margin: 0 0 7px;
  white-space: pre-wrap;
}

.process-notes-list article small {
  color: #748194;
  font-size: 11px;
}

.process-timeline article {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 12px;
  padding: 0 0 20px;
}

.process-timeline article > span {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: #3d78bd;
  box-shadow: 0 0 0 4px #e8f1fb;
}

.process-timeline strong,
.process-event-card strong {
  display: block;
  color: #203247;
}

.process-timeline p,
.process-event-card p {
  margin: 4px 0 0;
  color: #748194;
}

.process-event-card {
  padding: 20px;
  border: 1px solid #dfe6ee;
  border-left: 4px solid #e6a72d;
  border-radius: 10px;
  background: #fbfcfe;
}

.process-event-card small {
  display: block;
  margin-bottom: 7px;
  color: #9b7234;
  font-weight: 800;
  letter-spacing: .08em;
}

.process-empty {
  color: #748194;
  font-size: 14px;
}

.process-inline-form {
  margin-bottom: 22px;
  padding: 18px;
  border: 1px solid #dfe7ef;
  border-radius: 12px;
  background: #f8fafc;
}

.process-inline-form h4 {
  margin: 0 0 14px;
  color: #203247;
  font-size: 15px;
}

.process-inline-form > div {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
}

.process-inline-form label {
  display: grid;
  gap: 6px;
  color: #31445a;
  font-size: 12px;
  font-weight: 700;
}

.process-inline-form input,
.process-inline-form textarea,
.process-event-card select {
  min-width: 0;
  border: 1px solid #d6e0e9;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  color: #203247;
  font: 13px "DM Sans", sans-serif;
}

.process-inline-form .activity-form-full {
  grid-column: 1 / -1;
}

.process-inline-form > button {
  margin-top: 13px;
}

.activity-form-error {
  min-height: 17px;
  margin: 8px 0 0;
  color: #b94d4d;
  font-size: 12px;
}

.process-activity-list {
  display: grid;
  gap: 12px;
}

.process-event-card select {
  margin-top: 13px;
}

.process-detail-actions {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.process-detail-actions .detail-close {
  position: static;
}

.deadline-owner {
  margin-top: 8px !important;
  color: #40536a !important;
}

.deadline-history {
  margin-top: 12px;
  border-top: 1px solid #e1e7ee;
  padding-top: 10px;
  color: #52687d;
  font-size: 12px;
}

.deadline-history summary {
  cursor: pointer;
  font-weight: 700;
}

.deadline-history div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
}

.deadline-history span {
  color: #748194;
}

.activity-status {
  display: inline-block;
  margin-top: 12px;
  padding: 5px 9px;
  border-radius: 14px;
  background: #eaf2fb;
  color: #245f9e;
  font-size: 11px;
  font-weight: 700;
}

.clickable-process:focus-visible td {
  background: #f0f6fc;
  outline: 2px solid #bcd1e7;
}

@media (max-width: 650px) {
  .process-detail-wide {
    grid-column: auto;
  }

  .process-inline-form > div {
    grid-template-columns: 1fr;
  }

  .process-inline-form .activity-form-full {
    grid-column: auto;
  }

  .process-note-form {
    grid-template-columns: 1fr;
  }
}

/* Central do processo */
#process-detail {
  box-sizing: border-box;
  width: min(1500px, calc(100vw - 310px));
  height: calc(100vh - 28px);
  max-width: none;
  max-height: none;
  margin: 14px 14px 14px auto;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 24px 70px #06132235;
  padding: 0;
}

#process-detail::backdrop { background: #132b4814; }

#process-detail .process-detail-content {
  box-sizing: border-box;
  height: 100%;
  max-height: none;
  overflow: auto;
  padding: 24px 28px 30px;
  background: #f7f9fc;
}

.process-center-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
  padding: 0 2px;
}

.process-back {
  display: block;
  width: auto;
  height: auto;
  margin: 0 0 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #55708d;
  font: 600 12px "DM Sans", sans-serif;
  cursor: pointer;
}

.process-center-kicker {
  color: #a27026;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .13em;
}

.process-center-header h2 {
  margin: 5px 0 7px;
  color: #142d4c;
  font: 700 clamp(20px, 2vw, 28px) "Playfair Display", serif;
}

.process-center-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px 14px;
  color: #667890;
  font-size: 12px;
}

.process-center-meta strong { color: #142d4c; font-size: 14px; }
.process-detail-actions { padding-top: 26px; white-space: nowrap; }
.process-detail-actions .icon-close { flex: none; }

.process-cover {
  padding: 18px 22px 12px;
  border: 1px solid #dce5ef;
  border-radius: 13px;
  background: #fff;
}

.process-cover > h3 {
  margin: 0 0 11px;
  color: #a27026;
  font-size: 13px;
}

.process-cover-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 30px;
}

.process-cover-columns dl { margin: 0; min-width: 0; }

.process-cover-row {
  display: grid;
  grid-template-columns: minmax(125px, 31%) 1fr;
  gap: 13px;
  min-height: 34px;
  align-items: center;
  border-top: 1px solid #e7edf3;
}

.process-cover-row:first-child { border-top: 0; }
.process-cover-row dt { color: #74849a; font-size: 11px; }
.process-cover-row dd { min-width: 0; margin: 0; color: #203750; font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.process-cover-row.cover-important dd { color: #133b6d; font-weight: 800; }

.process-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 10px;
}

.process-quick-actions button,
.process-quick-actions label {
  width: auto;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
}

.process-quick-actions .secondary { border: 1px solid #d6e0ea; background: #fff; color: #29445f; }
.process-quick-actions .primary { background: #c88917; border-color: #c88917; }

#process-detail .process-tabs {
  margin: 0;
  padding: 0 8px;
  border: 1px solid #dce5ef;
  border-radius: 11px 11px 0 0;
  background: #fff;
}

#process-detail .process-tabs button { padding: 13px 12px 11px; border-radius: 0; border-bottom: 2px solid transparent; }
#process-detail .process-tabs button.active { background: transparent; border-bottom-color: #c88917; color: #9b6811; }

#process-detail .process-tab-panel {
  padding: 18px;
  border: 1px solid #dce5ef;
  border-top: 0;
  border-radius: 0 0 11px 11px;
  background: #fff;
}

.timeline-title,
.process-related-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 13px;
}

.timeline-title h3,
.process-related-heading h3 { margin: 0; color: #203750; font-size: 15px; }
.timeline-title p,
.process-related-heading p { margin: 3px 0 0; color: #74849a; font-size: 11px; }

.unified-timeline { overflow-x: auto; border: 1px solid #e1e8ef; border-radius: 9px; }
.timeline-head,
.unified-timeline article { display: grid; grid-template-columns: 105px 100px minmax(260px, 1fr) 155px 105px; gap: 12px; align-items: center; min-width: 780px; padding: 10px 12px; }
.timeline-head { background: #f5f8fb; color: #60738a; font-size: 10px; font-weight: 800; }
.unified-timeline article { border-top: 1px solid #e7edf3; color: #3d5268; font-size: 11px; }
.unified-timeline article time { color: #5e7188; }
.unified-timeline article strong { display: block; color: #203750; font-size: 12px; }
.unified-timeline article small { display: block; margin-top: 2px; color: #74849a; }
.timeline-kind,
.timeline-state { justify-self: start; padding: 4px 8px; border-radius: 12px; background: #eaf2fb; color: #2865a4; font-size: 10px; font-weight: 700; }
.kind-audiencia { background: #f0eafb; color: #6944a7; }
.kind-prazo { background: #e7f6ec; color: #27834d; }
.kind-documento { background: #fff2dc; color: #a56912; }
.kind-observacao { background: #f1f2f4; color: #626d79; }

.party-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.party-grid article { padding: 18px; border: 1px solid #e0e7ee; border-radius: 10px; background: #fbfcfe; }
.party-grid small { color: #a27026; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.party-grid h3 { margin: 8px 0 5px; color: #203750; font-size: 14px; }
.party-grid p { margin: 0; color: #74849a; font-size: 11px; }

@media (max-width: 1050px) {
  #process-detail { width: calc(100vw - 28px); }
  .process-cover-columns { grid-template-columns: 1fr; gap: 0; }
  .process-cover-columns dl + dl { margin-top: 8px; border-top: 2px solid #dce5ef; }
}

@media (max-width: 650px) {
  #process-detail { width: 100vw; height: 100vh; margin: 0; border-radius: 0; }
  #process-detail .process-detail-content { padding: 16px; }
  .process-center-header { display: block; }
  .process-detail-actions { padding-top: 12px; }
  .process-cover-row { grid-template-columns: 1fr; gap: 2px; padding: 8px 0; }
  .party-grid { grid-template-columns: 1fr; }
}
