/* EscalaX — ações dos fluxos de trabalho (v3). Mesmo visual do menu e das janelas da lista de fluxos. */
.exfa-root {
  --exfa-surface: #222225;
  --exfa-menu: #25262a;
  --exfa-field: #0e0f11;
  --exfa-border: rgba(207, 211, 216, 0.24);
  --exfa-border-soft: rgba(207, 211, 216, 0.13);
  --exfa-text: #e0e3e7;
  --exfa-text-soft: #cfd3d8;
  --exfa-muted: #88919c;
  --exfa-blue: #6ba4ff;
  --exfa-red: #ff7a86;
  --exfa-green: #55e884;
  --exfa-yellow: #f5c451;
  color: var(--exfa-text);
  font-family: "Inter Variable", Inter, sans-serif;
  font-size: 14px;
  letter-spacing: -0.09px;
  line-height: 20px;
  -webkit-font-smoothing: antialiased;
}

.exfa-root *,
.exfa-root *::before,
.exfa-root *::after {
  box-sizing: border-box;
}

.exfa-hidden {
  position: fixed;
  top: 0;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Menu: medidas do menu Ações do respond.io (lista Vuetify escura). */
.exfa-menu {
  position: fixed;
  z-index: 210;
  min-width: 262px;
  max-width: 320px;
  padding: 8px 0;
  border: 0;
  border-radius: 4px;
  background: #2f2f32;
  box-shadow:
    0 5px 5px -3px #0003,
    0 8px 10px 1px #00000024,
    0 3px 14px 2px #0000001f;
  animation: exfa-in 120ms cubic-bezier(0, 0, 0.2, 1) both;
}

.exfa-menu__item {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 0;
  padding: 4px 16px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  line-height: 18px;
  text-align: left;
}

.exfa-menu__item:hover,
.exfa-menu__item:focus-visible {
  outline: 0;
  background: #ffffff0f;
}

.exfa-menu__item:focus-visible {
  box-shadow: inset 0 0 0 1px var(--exfa-blue);
}


.exfa-menu__item[aria-disabled="true"],
.exfa-menu__item[aria-disabled="true"]:hover {
  background: transparent;
  color: #6b727b;
  cursor: default;
  font-weight: 400;
}

/* Ícone 16px com o mesmo espaço (8px) da lixeira do "Apagar" original, alinhado à 1ª linha. */
.exfa-icon {
  display: block;
  flex: none;
}

.exfa-menu__item > .exfa-icon {
  margin-top: 2px;
}

.exfa-menu__text {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.exfa-menu__hint {
  color: var(--exfa-muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
}

.exfa-menu__sep {
  height: 1px;
  margin: 4px 2px;
  background: var(--exfa-border-soft);
}

/* Janela */
.exfa-backdrop {
  position: fixed;
  z-index: 220;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: #0006;
  animation: exfa-fade 225ms cubic-bezier(0, 0, 0.2, 1) both;
}

.exfa-modal {
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  border-radius: 8px;
  background: var(--exfa-surface);
  color: var(--exfa-text-soft);
  animation: exfa-dialog-in 225ms cubic-bezier(0, 0, 0.2, 1) both;
}

.exfa-modal__header {
  display: flex;
  height: 49px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 10px 0 12px;
  border-bottom: 1px solid var(--exfa-border-soft);
}

.exfa-modal__header h2 {
  overflow: hidden;
  margin: 0;
  color: #d5d8dd;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.1px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exfa-modal__close {
  display: grid;
  width: 32px;
  height: 32px;
  flex: none;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: #414246;
  color: #d3d6da;
  cursor: pointer;
}

.exfa-modal__close:hover {
  background: #4b4d52;
}

.exfa-modal__body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.exfa-modal__body p {
  margin: 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.exfa-modal__label {
  color: #d5d8dd;
  font-weight: 600;
}

.exfa-modal__error {
  color: var(--exfa-red);
}

.exfa-modal__error[hidden] {
  display: none;
}

.exfa-modal__footer {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: flex-end;
  gap: 11px;
  padding: 8px 12px;
}

.exfa-muted {
  color: var(--exfa-muted);
}

.exfa-list {
  display: grid;
  gap: 4px;
  max-height: 200px;
  overflow: auto;
  margin: 0;
  padding-left: 18px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.exfa-list--aviso li::marker {
  color: var(--exfa-yellow);
}

.exfa-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.exfa-field > span {
  color: #9ea5ae;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
}

.exfa-input {
  width: 100%;
  height: 32px;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid rgba(207, 211, 216, 0.15);
  border-radius: 8px;
  outline: 0;
  background: var(--exfa-field);
  color: #e2e4e7;
  font: inherit;
}

.exfa-input:focus {
  border-color: var(--exfa-blue);
}

.exfa-btn {
  height: 32px;
  border: 0;
  border-radius: 8px;
  padding: 0 13px;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 550;
}

.exfa-btn:focus-visible,
.exfa-modal__close:focus-visible,
.exfa-toast__close:focus-visible,
.exfa-toast__action:focus-visible {
  outline: 2px solid var(--exfa-blue);
  outline-offset: 2px;
}

.exfa-btn:disabled {
  cursor: default;
  opacity: 0.6;
}

/* Botão principal ocupado: mesmo cinza do "Criando…" da janela original. */
.exfa-btn--primary:disabled,
.exfa-btn--danger:disabled {
  background: #7a7a7f;
  color: #525256;
  opacity: 1;
}

.exfa-btn--ghost {
  color: #d5d8dc;
}

.exfa-btn--ghost:hover:not(:disabled) {
  background: #ffffff0e;
}

.exfa-btn--primary {
  min-width: 62px;
  background: var(--exfa-blue);
  color: #0e1722;
}

.exfa-btn--primary:hover:not(:disabled) {
  background: #82b3ff;
}

.exfa-btn--danger {
  min-width: 62px;
  background: #d45d6b;
  color: #0e1722;
}

.exfa-btn--danger:hover:not(:disabled) {
  background: #e37682;
}

/* Avisos */
.exfa-toasts {
  position: fixed;
  z-index: 230;
  bottom: 24px;
  left: 50%;
  display: flex;
  width: min(520px, calc(100vw - 32px));
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  transform: translateX(-50%);
}

.exfa-toast {
  display: flex;
  max-width: 100%;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 10px 10px 12px;
  border: 1px solid var(--exfa-border);
  border-left: 3px solid var(--exfa-green);
  border-radius: 8px;
  background: var(--exfa-menu);
  box-shadow: 0 12px 28px #00000059;
  color: var(--exfa-text);
  pointer-events: auto;
  animation: exfa-in 160ms cubic-bezier(0, 0, 0.2, 1) both;
}

.exfa-toast--erro {
  border-left-color: var(--exfa-red);
}

.exfa-toast--aviso {
  border-left-color: var(--exfa-yellow);
}

.exfa-toast--info {
  border-left-color: var(--exfa-blue);
}

.exfa-toast__action {
  flex: none;
  height: 22px;
  border: 0;
  border-radius: 5px;
  padding: 0 8px;
  background: transparent;
  color: var(--exfa-blue);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  line-height: 22px;
}

.exfa-toast__action:hover {
  background: #6ba4ff1f;
}

.exfa-toast__text {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.exfa-toast__close {
  display: grid;
  flex: none;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--exfa-muted);
  cursor: pointer;
}

.exfa-toast__close:hover {
  background: #ffffff14;
  color: var(--exfa-text);
}

/*
 * Lista recarregando depois de Clonar/Importar/Renomear/Publicar/Parar: a tela original insere
 * "Carregando fluxos de trabalho…" como uma linha a mais da grade e empurra a tabela para baixo.
 * Só enquanto a peça recarrega, esse texto fica escondido à vista (leitor de tela ainda lê) e a
 * tabela não pula. Nenhum nó do React é alterado: é só CSS.
 */
body:has(> .exfa-root[data-atualizando="true"]) .workflow-list-page[aria-busy="true"] > p[role="status"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes exfa-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* Mesma entrada da janela original (workflow-list-dialog-in). */
@keyframes exfa-dialog-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes exfa-fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .exfa-menu,
  .exfa-backdrop,
  .exfa-modal,
  .exfa-toast {
    animation: none;
  }
}

/* Configurações de fluxo de trabalho (janela igual à do respond.io) */
.exfa-modal--settings {
  width: min(432px, calc(100vw - 32px));
}

.exfa-modal--settings .exfa-modal__body {
  gap: 20px;
}

.exfa-setting__block {
  display: grid;
  gap: 2px;
}

.exfa-setting {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  color: var(--exfa-text-soft);
  font-size: 14px;
  line-height: 20px;
}

.exfa-setting__help {
  margin: 0;
  color: var(--exfa-text-soft);
  font-size: 14px;
  line-height: 20px;
}

.exfa-setting__missing {
  margin: 0;
  color: #f44336;
  font-size: 14px;
  line-height: 20px;
}

.exfa-setting__missing[hidden],
.exfa-setting__checks[hidden] {
  display: none;
}

.exfa-setting__checks {
  display: grid;
  gap: 2px;
  margin-top: 16px;
}

.exfa-switch {
  position: relative;
  display: inline-flex;
  width: 36px;
  height: 20px;
  flex: none;
}

.exfa-switch__input,
.exfa-check__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.exfa-switch__track {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: #4a4b4f;
  transition: background 150ms;
}

.exfa-switch__track::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  content: "";
  transition: transform 150ms;
}

.exfa-switch__input:checked + .exfa-switch__track {
  background: #6f8ff7;
}

.exfa-switch__input:checked + .exfa-switch__track::after {
  transform: translateX(16px);
}

.exfa-switch__input:focus-visible + .exfa-switch__track,
.exfa-check__input:focus-visible + .exfa-check__box {
  outline: 2px solid var(--exfa-blue);
  outline-offset: 2px;
}

.exfa-check {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--exfa-text-soft);
  cursor: pointer;
  font-size: 14px;
  line-height: 20px;
}

.exfa-check__input {
  width: 18px;
  height: 18px;
}

.exfa-check__box {
  position: relative;
  width: 18px;
  height: 18px;
  flex: none;
  border: 2px solid #cfd3d8;
  border-radius: 3px;
}

.exfa-check__input:checked + .exfa-check__box {
  border-color: #6f8ff7;
  background: #6f8ff7;
}

.exfa-check__input:checked + .exfa-check__box::after {
  position: absolute;
  top: 1px;
  left: 4px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  content: "";
  transform: rotate(45deg);
}

.exfa-check__tip {
  display: inline-grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 50%;
  background: #cfd3d8;
  color: #2b2b2e;
  cursor: help;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
