.process-system-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem .55rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  flex-shrink: 0;
}
.process-system-badge.themis { color: #805313; background: #fff4df; }
.process-system-badge.eproc { color: #155a8a; background: #e9f4ff; }
.process-system-badge.unknown { color: #586779; background: #f1f4f7; }
.process-system-badge svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.process-system-badge .process-system-label { display: inline; padding: 0; background: transparent; color: inherit; letter-spacing: 0; text-transform: none; border-radius: 0; font: inherit; }
#detail-system { display: block; margin: .5rem 0; }
.process-indicators { flex-wrap: wrap; }

.process-status span.pending,
.table-status.pending {
  color: #805a08;
  background: #fff3cf;
}

.process-status span.error,
.table-status.error {
  color: #a22d2d;
  background: #ffebeb;
}

.activation-notice {
  margin: -.25rem 0 .9rem;
  padding: .7rem .8rem;
  border-radius: .65rem;
  background: #eef6f3;
  color: #285746;
  font-size: .76rem;
  line-height: 1.45;
}

.activation-notice.pending {
  background: #fff8df;
  color: #76550c;
}

.activation-notice.error {
  background: #fff0f0;
  color: #8e2929;
}

.detail-frame > header .button.ghost {
  border-color: rgba(255, 255, 255, .72);
  background: rgba(255, 255, 255, .12);
  color: #fff;
}

.detail-frame > header .button.ghost:hover,
.detail-frame > header .button.ghost:focus-visible {
  background: #fff;
  color: var(--navy);
}

.detail-frame > header .button.key-access-action {
  border: 1px solid #fff;
  background: #fff;
  color: #102f49;
  box-shadow: 0 7px 18px rgba(0, 0, 0, .16);
}

.detail-frame > header .button.key-access-action:hover,
.detail-frame > header .button.key-access-action:focus-visible {
  background: #e7f5ef;
  border-color: #e7f5ef;
  color: #0a5e47;
}

.process-indicators,
.table-process-number {
  display: flex;
  align-items: center;
  gap: .4rem;
}

.process-indicators {
  margin-left: auto;
}

.pending-state-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  border-radius: 50%;
  background: #fff3cf;
  color: #805a08;
  font-style: normal;
  cursor: help;
}

.pending-state-icon .pending-key {
  font-size: 14px;
  line-height: 1;
}

.pending-state-icon .pending-hourglass {
  font-size: 14px;
  line-height: 1;
  animation: tjassistente-hourglass 1.8s ease-in-out infinite;
}

.pending-state-icon.key-pending .pending-hourglass {
  position: absolute;
  right: -5px;
  bottom: -5px;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #f2c45b;
  font-size: 9px;
}

.pending-state-icon.compact {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
  border-radius: 5px;
}

.pending-state-icon.compact .pending-key,
.pending-state-icon.compact .pending-hourglass {
  font-size: 10px;
}

.pending-state-icon.compact.key-pending .pending-hourglass {
  right: -6px;
  bottom: -6px;
  width: 13px;
  height: 13px;
  font-size: 7px;
}

@keyframes tjassistente-hourglass {
  0%, 42% { transform: rotate(0deg); }
  58%, 100% { transform: rotate(180deg); }
}

.process-status-messages {
  display: grid;
  gap: .45rem;
  margin-top: .8rem;
}

.process-status-messages .activation-notice {
  margin: 0;
}

.table-status-messages {
  display: grid;
  gap: .35rem;
  min-width: 210px;
  margin-top: .5rem;
}

.table-status-messages small {
  display: block;
  color: #76550c;
  font-size: .68rem;
  line-height: 1.35;
}

.table-status-messages small.error {
  color: #8e2929;
}

@media (prefers-reduced-motion: reduce) {
  .pending-state-icon .pending-hourglass { animation: none; }
}

.key-access-icon {
  display: inline-grid;
  place-items: center;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  border-radius: 50%;
  background: #fff4cf;
  color: #805a08;
  font-size: 14px;
  line-height: 1;
  font-style: normal;
  cursor: help;
}

.key-access-icon.compact {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
  border-radius: 4px;
  font-size: 10px;
}

.unread-events-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  border-radius: 50%;
  background: #e7f5ef;
  color: #0a5e47;
  font-size: 13px;
  line-height: 1;
  font-style: normal;
  cursor: help;
}

.unread-events-icon b {
  position: absolute;
  right: -5px;
  top: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #a13b3b;
  color: #fff;
  font: 800 8px/1 system-ui, sans-serif;
}

.unread-events-icon.compact {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
  border-radius: 4px;
  font-size: 9px;
}

.unread-events-icon.compact b {
  right: -7px;
  top: -8px;
  transform: scale(.8);
}

.detail-tabs button {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
}

.tab-unread-indicator {
  margin-left: .05rem;
}

.event-number-heading,
.event-table-number,
.appeal-number-heading,
.file-name-heading {
  display: flex;
  align-items: center;
  gap: .55rem;
}

.event-number-heading .event-unread-indicator,
.event-table-number .event-unread-indicator {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  font-size: 10px;
}

.appeal-row.unread {
  border-left: 4px solid var(--green);
}

.file-row.unread {
  border-left: 4px solid var(--green);
}

.file-name-heading .file-unread-indicator {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  font-size: 10px;
}

.table-process-number {
  align-items: flex-start;
}

.detail-dialog {
  height: calc(100dvh - 1rem);
  max-height: none;
}

.detail-frame {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.detail-frame > header {
  flex: 0 0 auto;
}

.metadata-grid {
  flex: 0 0 auto;
  max-height: none;
  overflow: visible;
  overscroll-behavior: contain;
}

.detail-data-grid {
  width: 100%;
  min-height: 100%;
  grid-auto-rows: minmax(78px, 1fr);
}

.detail-navigation {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding-right: 1.25rem;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.detail-navigation .detail-tabs {
  flex: 1 1 auto;
  min-width: 0;
  border-bottom: 0;
}

.detail-view-switch {
  flex: 0 0 auto;
  display: flex;
  height: 38px;
  padding: .2rem;
  border-radius: .6rem;
  background: #e7ecec;
}

.detail-view-switch button {
  border: 0;
  border-radius: .45rem;
  padding: 0 .7rem;
  background: transparent;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 750;
}

.detail-view-switch button.active {
  background: #fff;
  color: var(--navy);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .07);
}

.detail-content {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
}

.detail-table-wrapper {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: #fff;
}

.detail-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: .76rem;
}

.detail-table th,
.detail-table td {
  padding: .7rem .75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.detail-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #edf3f2;
  color: var(--navy);
  font-size: .68rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.detail-table tr:last-child td {
  border-bottom: 0;
}

.detail-table tr.new td:first-child {
  border-left: 4px solid var(--green);
}

.detail-table td a {
  color: var(--green);
  font-weight: 800;
}

.detail-table td .new-badge {
  display: inline-block;
  margin-left: .45rem;
}

.compact-files {
  margin-top: 0;
}

.compact-files .file-button {
  padding: .35rem .5rem;
  font-size: .68rem;
}

@media (max-width: 760px) {
  .detail-dialog {
    height: 100dvh;
  }

  .metadata-grid {
    max-height: none;
    overflow: visible;
  }

  .detail-data-grid {
    min-height: 100%;
    grid-auto-rows: minmax(72px, auto);
  }

  .detail-navigation {
    gap: .35rem;
    padding-right: .45rem;
  }

  .detail-navigation .detail-tabs {
    padding-right: 0;
  }

  .detail-view-switch {
    height: 36px;
  }

  .detail-view-switch button {
    padding: 0 .5rem;
    font-size: .7rem;
  }
}
