.ap-processos {
  --ap-processos-accent: #0094c6;
  --ap-processos-border: #d7e0e2;
  --ap-processos-text: #263238;
  color: var(--ap-processos-text);
}

.ap-processos__filters-container {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.ap-processos__filters {
  display: grid;
  gap: 10px;
}

.ap-processos__filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ap-processos__filter-buttons button {
  padding: 9px 14px;
  border: 1px solid var(--ap-processos-border);
  border-radius: 6px;
  background: #fff;
  color: var(--ap-processos-text);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.ap-processos__filter-buttons button:hover,
.ap-processos__filter-buttons button[aria-pressed="true"] {
  border-color: var(--ap-processos-accent);
  background: var(--ap-processos-accent);
  color: #fff;
}

.ap-processos__search {
  display: grid;
  width: min(100%, 380px);
  gap: 6px;
  font-weight: 600;
}

.ap-processos__search-input {
  box-sizing: border-box;
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--ap-processos-border);
  border-radius: 6px;
  font: inherit;
}

.ap-processos__results {
  margin: 0 0 12px;
  font-size: 0.9rem;
}

.ap-processos__cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 20px;
}

.ap-processos__pagination[hidden] {
  display: none;
}

.ap-processos__pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
}

.ap-processos__page-numbers {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.ap-processos__page-button {
  min-width: 40px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--ap-processos-border);
  border-radius: 6px;
  background: #fff;
  color: var(--ap-processos-text);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.ap-processos__page-button:hover:not(:disabled),
.ap-processos__page-button[aria-current="page"] {
  border-color: var(--ap-processos-accent);
  background: var(--ap-processos-accent);
  color: #fff;
}

.ap-processos__page-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.ap-processos__card {
  position: relative;
  display: flex;
  align-items: stretch;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--ap-processos-border);
  border-radius: 10px;
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.ap-processos__card[hidden],
.ap-processos__empty[hidden] {
  display: none;
}

.ap-processos__card:hover {
  border-color: var(--ap-processos-accent);
  box-shadow: 0 4px 14px rgb(38 50 56 / 10%);
}

.ap-processos__card-trigger {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: inherit;
  background: transparent!important;
  cursor: pointer;
}

.ap-processos__card-trigger:focus-visible {
  outline: 3px solid var(--ap-processos-accent);
  outline-offset: -4px;
}

.ap-processos__card-content {
  display: flex;
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
}

.ap-processos__card-hint {
  color: var(--ap-processos-accent);
  font-weight: 700;
}

.ap-processos__status {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #e7f4f3;
  color: #17645c;
  font-size: 0.8rem;
  font-weight: 700;
}

.ap-processos__status--finalizado {
  background: #ebdf06;
  color: #202121;
}

.ap-processos__status--cancelado {
  background: #fcebea;
  color: #a2332b;
}

.ap-processos__card-title {
  margin: 0 0 10px;
  color: inherit;
  font-size: 1.2rem;
  line-height: 1.35;
}

.ap-processos__details {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
}

.ap-processos__detail dt {
  font-size: 0.85rem;
  font-weight: 700;
}

.ap-processos__detail dd {
  margin: 2px 0 0;
}

.ap-processos__modal {
  box-sizing: border-box;
  width: min(760px, calc(100vw - 32px));
  max-width: 760px;
  max-height: min(85vh, 800px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  background: #fff;
  color: var(--ap-processos-text);
  box-shadow: 0 24px 70px rgb(0 0 0 / 30%);
}

.ap-processos__modal::backdrop {
  background: rgb(20 30 34 / 72%);
  backdrop-filter: blur(3px);
}

.ap-processos__modal-content {
  box-sizing: border-box;
  max-height: min(85vh, 800px);
  overflow: auto;
  padding: 76px clamp(22px, 5vw, 48px) 36px;
  overscroll-behavior: contain;
}

.ap-processos__modal-description {
  font-size: 1rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.ap-processos__modal-description h1,
.ap-processos__modal-description h2,
.ap-processos__modal-description h3,
.ap-processos__modal-description h4 {
  margin-top: 0;
  line-height: 1.3;
}

.ap-processos__modal-description > :last-child {
  margin-bottom: 0;
}

.ap-processos__modal-description img {
  max-width: 100%;
  height: auto;
}

.ap-processos__modal-description table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

.ap-processos__modal-close {
  position: absolute;
  z-index: 2;
  top: 16px;
  right: 16px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 0;
  border: 1px solid #e1e8e9!important;
  border-radius: 50%;
  background: #fff!important;
  color: var(--ap-processos-text)!important;
  cursor: pointer;
  font-size: 1.6rem;
  line-height: 1;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.ap-processos__modal-close:hover,
.ap-processos__modal-close:focus-visible {
  border-color: var(--ap-processos-accent);
  background: #edf7f7;
}

.ap-processos__card-media {
  order: -1;
  flex: 0 0 30%;
  width: 30%;
  max-width: 180px;
  overflow: hidden;
  background: #edf1f2!important;
}

.ap-processos__card-image {
  display: block;
  width: 100%!important;
  height: 100%!important;
  object-fit: cover!important;
  object-position: center!important;
}

.ap-processos__empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 20px;
  border: 1px dashed var(--ap-processos-border);
  border-radius: 8px;
  text-align: center;
}

@media (max-width: 700px) {
  .ap-processos__filters-container {
    align-items: stretch;
    flex-direction: column;
  }

  .ap-processos__search {
    width: 100%;
  }

  .ap-processos__card-media {
    flex-basis: 28%;
    width: 28%;
  }

  .ap-processos__card-content {
    padding: 16px;
  }
}

@media (max-width: 420px) {
  .ap-processos__card-media {
    flex-basis: 26%;
    width: 26%;
  }

  .ap-processos__card-content {
    padding: 12px;
  }

  .ap-processos__modal {
    width: calc(100vw - 20px);
    max-height: 90vh;
  }

  .ap-processos__modal-content {
    max-height: 90vh;
    padding: 70px 20px 24px;
  }
}
