/*
 * Administration external connections page:
 * templates/core/administracao_external_connections.html.twig
 */

.app-main:has(#admin-external-connections-page) {
  margin-top: var(--navbar-h) !important;
  margin-right: 0;
  width: calc(100% - var(--sidebar-collapsed-w));
  padding-top: 0 !important;
}

#admin-external-connections-page {
  min-height: calc(100vh - var(--navbar-h));
  padding: clamp(0.85rem, 1.4vw, 1.35rem);
  background: #fff;
  color: #17251d;
}

.aex-page .aex-tabs {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.aex-page .wmg-tab {
  min-height: 3.45rem;
}

.aex-subpanels {
  display: grid;
  gap: 1rem;
}

.aex-subpanel[hidden] {
  display: none;
}

.aex-board {
  display: grid;
  gap: 1rem;
}

.aex-configured-table .cc-work-table-card {
  border-radius: 0.52rem;
  box-shadow: none;
}

.aex-configured-table .cc-work-table-toolbar {
  padding-inline: 0.8rem;
}

.aex-alert {
  padding: 0.8rem 0.9rem;
  border: 1px solid #fcd34d;
  border-radius: 0.5rem;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.78rem;
  font-weight: 760;
}

.aex-llm-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.aex-llm-overview span {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
  padding: 0.85rem 0.95rem;
  border: 1px solid #e2ebe6;
  border-radius: 0.5rem;
  background: #fbfdfc;
}

.aex-llm-overview strong {
  color: #17251d;
  font-size: 1.2rem;
  font-weight: 920;
}

.aex-llm-overview em {
  color: #66726d;
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 820;
}

body.aex-transcript-modal-open {
  overflow: hidden;
}

.aex-transcript-modal {
  position: fixed;
  inset: 0;
  z-index: 2600;
  display: none;
}

.aex-transcript-modal.is-open {
  display: block;
}

.aex-transcript-modal__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.44);
  backdrop-filter: blur(14px);
  cursor: default;
}

.aex-transcript-modal__dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  flex-direction: column;
  width: min(1080px, calc(100vw - 2rem));
  height: min(820px, calc(100vh - 4rem));
  overflow: hidden;
  transform: translate(-50%, -50%);
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #fff;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.2);
}

.aex-transcript-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #f1f5f9;
}

.aex-transcript-modal__kicker {
  display: block;
  margin-bottom: 0.15rem;
  color: #94a3b8;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.aex-transcript-modal__title {
  margin: 0;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0;
}

.aex-transcript-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.4rem;
  background: #fff;
  color: #64748b;
  cursor: pointer;
}

.aex-transcript-modal__close:hover,
.aex-transcript-modal__close:focus-visible {
  border-color: #16813b;
  color: #16813b;
  outline: none;
}

.aex-transcript-modal__close .material-symbols-outlined {
  font-size: 1.05rem;
}

.aex-transcript-modal__tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow-x: auto;
  padding: 0.45rem 1rem;
  border-bottom: 1px solid #f1f5f9;
}

.aex-transcript-modal__tab {
  min-height: 1.9rem;
  padding: 0 0.7rem;
  border: 1px solid transparent;
  border-radius: 0.4rem;
  background: transparent;
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}

.aex-transcript-modal__tab.is-active,
.aex-transcript-modal__tab:hover,
.aex-transcript-modal__tab:focus-visible {
  border-color: #99f6e4;
  background: #f0fdfa;
  color: #115e59;
  outline: none;
}

.aex-transcript-modal__body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 1rem;
  background: #f8fafc;
}

.aex-transcript-modal__loading,
.aex-transcript-modal__error,
.aex-transcript-empty {
  padding: 1rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #64748b;
  font-size: 0.82rem;
}

.aex-transcript-modal__error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.aex-transcript-modal__panel {
  display: none;
}

.aex-transcript-modal__panel.is-active {
  display: block;
}

.aex-transcript-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.65rem;
}

.aex-transcript-detail-item,
.aex-transcript-note,
.aex-transcript-topic,
.aex-transcript-segment {
  border: 1px solid #e5e7eb;
  background: #fff;
}

.aex-transcript-detail-item {
  display: flex;
  min-height: 4.3rem;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.7rem;
}

.aex-transcript-detail-item span,
.aex-transcript-note span {
  color: #94a3b8;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.aex-transcript-detail-item strong {
  overflow-wrap: anywhere;
  color: #0f172a;
  font-size: 0.8rem;
}

.aex-transcript-note {
  margin-top: 0.75rem;
  padding: 0.8rem;
}

.aex-transcript-note--danger {
  border-color: #fecaca;
}

.aex-transcript-note p {
  margin: 0.35rem 0 0;
  color: #334155;
  font-size: 0.82rem;
  white-space: pre-wrap;
}

.aex-transcript-topic-list,
.aex-transcript-segments {
  display: grid;
  gap: 0.65rem;
}

.aex-transcript-topic,
.aex-transcript-segment {
  padding: 0.8rem;
}

.aex-transcript-topic__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.aex-transcript-topic__head strong {
  color: #0f172a;
  font-size: 0.86rem;
}

.aex-transcript-topic__head span,
.aex-transcript-segment span {
  color: #115e59;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}

.aex-transcript-topic p,
.aex-transcript-segment p {
  margin: 0.45rem 0 0;
  color: #334155;
  font-size: 0.86rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.aex-transcript-text,
.aex-transcript-json {
  margin: 0;
  overflow-wrap: anywhere;
  padding: 1rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #334155;
  font-size: 0.8rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.aex-transcript-json {
  font-size: 0.74rem;
}

body.aex-llm-modal-open {
  overflow: hidden;
}

.aex-llm-modal {
  position: fixed;
  inset: 0;
  z-index: 2600;
  display: none;
}

.aex-llm-modal.is-open {
  display: block;
}

.aex-llm-modal__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(12px);
  cursor: default;
}

.aex-llm-modal__dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  flex-direction: column;
  width: min(980px, calc(100vw - 2rem));
  max-height: min(760px, calc(100vh - 4rem));
  overflow: hidden;
  transform: translate(-50%, -50%);
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #fff;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.2);
}

.aex-llm-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #f1f5f9;
}

.aex-llm-modal__kicker {
  display: block;
  margin-bottom: 0.15rem;
  color: #16813b;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.aex-llm-modal__title {
  margin: 0;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 850;
  letter-spacing: 0;
}

.aex-llm-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.4rem;
  background: #fff;
  color: #64748b;
  cursor: pointer;
}

.aex-llm-modal__close:hover,
.aex-llm-modal__close:focus-visible {
  border-color: #16813b;
  color: #16813b;
  outline: none;
}

.aex-llm-modal__close .material-symbols-outlined {
  font-size: 1.05rem;
}

.aex-llm-modal__body {
  display: grid;
  gap: 0.85rem;
  overflow: auto;
  padding: 1rem;
  background: #f8fafc;
}

.aex-llm-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

.aex-llm-detail-item,
.aex-llm-comparison section,
.aex-llm-note {
  border: 1px solid #e5e7eb;
  background: #fff;
}

.aex-llm-detail-item {
  display: grid;
  gap: 0.22rem;
  min-width: 0;
  padding: 0.72rem;
}

.aex-llm-detail-item span,
.aex-llm-comparison span,
.aex-llm-note span {
  color: #94a3b8;
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.aex-llm-detail-item strong {
  overflow-wrap: anywhere;
  color: #0f172a;
  font-size: 0.8rem;
  font-weight: 850;
}

.aex-llm-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.aex-llm-comparison section,
.aex-llm-note {
  display: grid;
  gap: 0.45rem;
  padding: 0.85rem;
}

.aex-llm-comparison p,
.aex-llm-note p {
  margin: 0;
  color: #334155;
  font-size: 0.86rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.aex-llm-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  padding-top: 0.2rem;
}

.aex-llm-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.2rem;
  padding: 0.45rem 0.95rem;
  border: 1px solid #dce7e1;
  border-radius: 0.36rem;
  background: #fff;
  font-size: 0.82rem;
  font-weight: 900;
  cursor: pointer;
}

.aex-llm-action .material-symbols-outlined {
  font-size: 1rem;
}

.aex-llm-action--reject {
  border-color: #fecaca;
  color: #b91c1c;
}

.aex-llm-action--approve {
  border-color: #92d2a7;
  background: #16813b;
  color: #fff;
}

.aex-llm-action:hover,
.aex-llm-action:focus-visible {
  outline: none;
  filter: brightness(0.97);
}

.aex-board__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.aex-board__icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 0.52rem;
  background: #e9f8ee;
  color: #16813b;
  font-size: 1.25rem;
}

.aex-board__header > span:last-child {
  display: grid;
  gap: 0.16rem;
  min-width: 0;
}

.aex-board__header strong {
  color: #17251d;
  font-size: 0.95rem;
  font-weight: 920;
}

.aex-board__header em {
  color: #66726d;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 760;
}

.aex-layout-preview {
  display: grid;
  grid-template-columns: minmax(12rem, 0.34fr) minmax(0, 1fr);
  min-height: 27rem;
  overflow: hidden;
  border: 1px solid #e2ebe6;
  border-radius: 0.55rem;
  background: #fbfdfc;
}

.aex-preview-sidebar {
  display: grid;
  align-content: start;
  gap: 0.65rem;
  padding: 1rem;
  border-right: 1px solid #e2ebe6;
  background: #f8fbf9;
}

.aex-preview-sidebar span,
.aex-preview-line,
.aex-preview-grid span {
  display: block;
  border-radius: 999px;
  background: linear-gradient(90deg, #eef0ef 0%, #e1e4e3 48%, #eef0ef 100%);
}

.aex-preview-sidebar span {
  height: 2.2rem;
}

.aex-preview-sidebar span:first-child {
  background: #e9f8ee;
}

.aex-preview-content {
  display: grid;
  align-content: start;
  gap: 1rem;
  padding: 1.15rem;
}

.aex-preview-line {
  width: min(21rem, 74%);
  height: 0.8rem;
}

.aex-preview-line--wide {
  width: min(32rem, 92%);
}

.aex-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.aex-preview-grid span {
  height: 8.5rem;
  border-radius: 0.5rem;
  background: #fff;
  border: 1px solid #e2ebe6;
}

@media (max-width: 900px) {
  .aex-page .aex-tabs {
    grid-template-columns: 1fr;
  }

  .aex-layout-preview {
    grid-template-columns: 1fr;
  }

  .aex-preview-sidebar {
    border-right: 0;
    border-bottom: 1px solid #e2ebe6;
  }

  .aex-preview-grid {
    grid-template-columns: 1fr;
  }

  .aex-llm-overview,
  .aex-llm-detail-grid,
  .aex-llm-comparison {
    grid-template-columns: 1fr;
  }

  .aex-transcript-modal__dialog {
    width: calc(100vw - 1rem);
    height: calc(100vh - 1rem);
  }

  .aex-transcript-modal__body {
    padding: 0.65rem;
  }

  .aex-llm-modal__dialog {
    width: calc(100vw - 1rem);
    max-height: calc(100vh - 1rem);
  }

  .aex-llm-modal__body {
    padding: 0.65rem;
  }

  .aex-llm-modal__actions {
    flex-direction: column;
  }
}
