/* StreamCore REPACK20 / FIX13 — servers header polish, Engine Manager final UX, neutral action portal. */

/* --------------------------------------------------------------------------
   Servers route header: title + actions aligned above the main servers card.
   -------------------------------------------------------------------------- */
html.sc-servers-route .servers-layout {
  max-width: min(1220px, calc(100vw - 42px)) !important;
  margin: 0 auto !important;
  gap: 14px !important;
}
html.sc-servers-route .sc-servers-header-inline {
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 -2px;
}
html.sc-servers-route .sc-servers-title {
  min-width: 0;
  display: grid;
  gap: 5px;
}
html.sc-servers-route .sc-servers-kicker {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #86a2c8;
}
html.sc-servers-route .sc-servers-title h2 {
  margin: 0 !important;
  font-size: clamp(26px, 2.5vw, 34px) !important;
  line-height: 1.08 !important;
  color: #f2f7ff !important;
}
html.sc-servers-route .sc-servers-title p {
  margin: 0;
  color: #8ea6c4;
  font-size: 12px;
}
html.sc-servers-route .servers-actions {
  margin: 0 0 0 auto !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: flex-end;
  gap: 10px !important;
  flex-wrap: wrap;
}
html.sc-servers-route .servers-actions .small-button,
html.sc-servers-route .servers-actions button {
  min-height: 40px !important;
  padding: 0 16px !important;
  border-radius: 10px !important;
  box-shadow: none !important;
}
html.sc-servers-route .server-table-panel {
  margin-top: 0 !important;
}
html.sc-servers-route .sc-hide-external-servers-heading {
  display: none !important;
}
.theme-light.sc-servers-route .sc-servers-title h2 { color: #14233a !important; }
.theme-light.sc-servers-route .sc-servers-title p,
.theme-light.sc-servers-route .sc-servers-kicker { color: #607895; }

@media (max-width: 860px) {
  html.sc-servers-route .sc-servers-header-inline {
    align-items: stretch;
    flex-direction: column;
  }
  html.sc-servers-route .servers-actions {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0 !important;
  }
}

/* --------------------------------------------------------------------------
   Server actions portal: remove useless first item + remove green emphasis from
   Reinstalar Proxy so all actions share the same neutral style.
   -------------------------------------------------------------------------- */
#sc-server-actions-portal button.sc-reinstall-action {
  margin-top: 0 !important;
  border-color: transparent !important;
  background: transparent !important;
  color: #d9e6f7 !important;
}
#sc-server-actions-portal button.sc-reinstall-action::before {
  background: rgba(var(--theme-accent-rgb,47,130,255),.72) !important;
}
.theme-light #sc-server-actions-portal button.sc-reinstall-action {
  color: #213550 !important;
}

/* --------------------------------------------------------------------------
   Engine Manager FIX13: more polished, readable, with a project-style yes/no
   toggle and tables that no longer collapse into narrow unreadable columns.
   -------------------------------------------------------------------------- */
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-card {
  width: min(1120px, calc(100vw - 44px)) !important;
  max-height: min(820px, calc(100dvh - 44px)) !important;
  border-radius: 18px !important;
}
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-head {
  padding: 18px 20px !important;
  background: linear-gradient(180deg, rgba(var(--theme-accent-rgb,47,130,255),.06), rgba(var(--theme-accent-rgb,47,130,255),.02)) !important;
}
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-head h2 {
  font-size: 24px !important;
  line-height: 1.1 !important;
}
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-head p {
  margin-top: 5px !important;
  font-size: 12px !important;
}
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-close {
  width: 38px !important;
  height: 38px !important;
  border-radius: 10px !important;
}
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-body {
  padding: 18px !important;
}
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, .78fr) !important;
  gap: 16px !important;
}
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-section {
  padding: 16px !important;
  border-radius: 14px !important;
}
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-section h3 {
  margin-bottom: 13px !important;
  font-size: 15px !important;
}
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-upload-row {
  grid-template-columns: minmax(0,1fr) auto !important;
  gap: 10px !important;
}
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-input,
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-select,
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-btn {
  min-height: 42px !important;
  border-radius: 10px !important;
  font-size: 12px !important;
}
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-btn {
  padding: 0 14px !important;
}
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-field {
  grid-template-columns: 96px minmax(0,1fr) !important;
  gap: 10px !important;
  margin: 10px 0 !important;
}
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-field label {
  font-size: 11px !important;
}
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-dependency-card {
  grid-template-columns: minmax(0,1fr) auto !important;
  gap: 14px !important;
  margin: 12px 0 !important;
  padding: 14px 14px !important;
  border-radius: 12px !important;
}
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-dependency-card strong {
  font-size: 12px !important;
}
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-dependency-card span {
  margin-top: 3px !important;
  font-size: 10px !important;
}
#sc-unified-engine-modal.sc-ue-v4 .sc-yesno-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-width: 84px;
  height: 40px;
  padding: 4px 10px 4px 6px;
  border: 1px solid var(--sc-admin-border,rgba(111,145,190,.24));
  border-radius: 999px;
  background: #1f2c46;
  cursor: pointer;
  user-select: none;
}
#sc-unified-engine-modal.sc-ue-v4 .sc-yesno-toggle input {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  opacity: 0 !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  cursor: pointer !important;
}
#sc-unified-engine-modal.sc-ue-v4 .sc-yesno-pill {
  position: relative;
  width: 50px;
  height: 28px;
  flex: 0 0 50px;
  border-radius: 999px;
  background: #344767;
  border: 1px solid rgba(150,175,210,.20);
  transition: background .18s ease, border-color .18s ease;
}
#sc-unified-engine-modal.sc-ue-v4 .sc-yesno-pill::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,.28);
  transition: transform .18s ease;
}
#sc-unified-engine-modal.sc-ue-v4 .sc-yesno-state {
  font-size: 12px;
  font-weight: 800;
  color: #dbe7f6;
}
#sc-unified-engine-modal.sc-ue-v4 .sc-yesno-toggle.is-on {
  background: rgba(var(--theme-accent-rgb,47,130,255),.12);
  border-color: rgba(var(--theme-accent-rgb,47,130,255),.32);
}
#sc-unified-engine-modal.sc-ue-v4 .sc-yesno-toggle.is-on .sc-yesno-pill {
  background: rgba(var(--theme-accent-rgb,47,130,255),.88);
  border-color: rgba(var(--theme-accent-rgb,47,130,255),.92);
}
#sc-unified-engine-modal.sc-ue-v4 .sc-yesno-toggle.is-on .sc-yesno-pill::after {
  transform: translateX(22px);
}
#sc-unified-engine-modal.sc-ue-v4 .sc-yesno-toggle.is-on .sc-yesno-state::before { content: "Sim"; }
#sc-unified-engine-modal.sc-ue-v4 .sc-yesno-toggle:not(.is-on) .sc-yesno-state::before { content: "Não"; }
#sc-unified-engine-modal.sc-ue-v4 .sc-yesno-toggle .sc-yesno-state { font-size: 0 !important; }
#sc-unified-engine-modal.sc-ue-v4 #sc-ue-packages {
  opacity: 0 !important;
  pointer-events: auto !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
}
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-deploy-actions {
  grid-template-columns: 1fr 1fr !important;
  gap: 10px !important;
  margin-top: 12px !important;
}
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-status {
  min-height: 44px !important;
  margin-top: 12px !important;
  padding: 11px 12px !important;
  border-radius: 10px !important;
  font-size: 11px !important;
}
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-progress {
  height: 7px !important;
  margin-top: 10px !important;
}
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-table-host {
  margin-top: 12px !important;
  border-radius: 10px !important;
}
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-releases-section .sc-ue-table-host {
  max-height: 360px;
  overflow: auto;
}
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-history-section .sc-ue-table-host {
  max-height: 240px;
  overflow: auto;
}
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-table {
  width: 100% !important;
  table-layout: auto !important;
  font-size: 11px !important;
}
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-table th,
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-table td {
  padding: 10px 10px !important;
  font-size: 11px !important;
  line-height: 1.35 !important;
  overflow: visible !important;
}
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  font-size: 9px !important;
}
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-release-table th:nth-child(1) { width: 84px !important; }
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-release-table th:nth-child(3) { width: 132px !important; }
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-release-table th:nth-child(4) { width: 74px !important; }
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-history-table th:nth-child(1) { width: 146px !important; }
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-history-table th:nth-child(2) { width: 92px !important; }
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-history-table th:nth-child(4),
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-history-table th:nth-child(5),
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-history-table th:nth-child(6) { width: 84px !important; }
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-engine-cell strong,
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-engine-cell .sc-ue-note {
  max-width: 100%;
  white-space: normal !important;
  overflow: hidden !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-engine-cell strong {
  font-size: 12px !important;
}
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-version {
  font-weight: 800;
  font-size: 12px;
}
#sc-unified-engine-modal.sc-ue-v4 code {
  font-size: 10px !important;
}
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-history-table td:nth-child(1),
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-history-table td:nth-child(4),
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-history-table td:nth-child(5),
#sc-unified-engine-modal.sc-ue-v4 .sc-ue-history-table td:nth-child(6) {
  white-space: nowrap !important;
}
.theme-light #sc-unified-engine-modal.sc-ue-v4 .sc-yesno-toggle {
  background: #edf3fb;
}
.theme-light #sc-unified-engine-modal.sc-ue-v4 .sc-yesno-state {
  color: #1f3550;
}
@media (max-width: 980px) {
  #sc-unified-engine-modal.sc-ue-v4 .sc-ue-grid {
    grid-template-columns: 1fr !important;
  }
  #sc-unified-engine-modal.sc-ue-v4 .sc-ue-card {
    width: min(96vw, 760px) !important;
  }
}
@media (max-width: 820px) {
  #sc-unified-engine-modal { padding: 10px !important; }
  #sc-unified-engine-modal.sc-ue-v4 .sc-ue-card {
    width: 100vw !important;
    max-height: 100dvh !important;
    height: 100dvh !important;
    border-radius: 0 !important;
  }
  #sc-unified-engine-modal.sc-ue-v4 .sc-ue-upload-row,
  #sc-unified-engine-modal.sc-ue-v4 .sc-ue-deploy-actions,
  #sc-unified-engine-modal.sc-ue-v4 .sc-ue-field {
    grid-template-columns: 1fr !important;
  }
}
