/* crews.css — UI dos squads CrewAI. Isolado em namespace .crews-* / .crew-*
   pra não conflitar com o HUD existente. Segue tokens cyan/amber do tema HUD. */

.crews-trigger {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9000;
  font-family: 'Orbitron', 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  padding: 10px 16px;
  background: linear-gradient(180deg, rgba(0, 228, 255, 0.12), rgba(0, 228, 255, 0.03));
  color: var(--cyan, #00e4ff);
  border: 1px solid rgba(0, 228, 255, 0.35);
  border-radius: 4px;
  cursor: pointer;
  text-transform: uppercase;
  box-shadow: 0 0 18px rgba(0, 228, 255, 0.18);
  transition: all 0.18s ease;
}
.crews-trigger:hover {
  background: linear-gradient(180deg, rgba(0, 228, 255, 0.22), rgba(0, 228, 255, 0.08));
  box-shadow: 0 0 28px rgba(0, 228, 255, 0.4);
  transform: translateY(-1px);
}

.crews-panel {
  position: fixed;
  right: 18px;
  bottom: 70px;
  z-index: 9100;
  width: 420px;
  max-width: calc(100vw - 36px);
  max-height: calc(100vh - 110px);
  background: rgba(1, 4, 8, 0.94);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 228, 255, 0.3);
  border-radius: 6px;
  box-shadow: 0 0 60px rgba(0, 228, 255, 0.15), 0 18px 50px rgba(0, 0, 0, 0.6);
  color: #cfe7ee;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.crews-panel.hidden { display: none; }

.crews-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(0, 228, 255, 0.18);
  background: linear-gradient(180deg, rgba(0, 228, 255, 0.08), transparent);
}
.crews-panel__head h2 {
  margin: 0;
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  letter-spacing: 0.16em;
  color: var(--cyan, #00e4ff);
  text-transform: uppercase;
}
.crews-panel__head-actions { display: flex; gap: 4px; }

.crews-icon {
  background: transparent;
  border: 1px solid rgba(0, 228, 255, 0.25);
  color: var(--cyan, #00e4ff);
  width: 26px;
  height: 26px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.crews-icon:hover { background: rgba(0, 228, 255, 0.12); }

.crews-status {
  padding: 6px 14px;
  font-size: 11px;
  color: rgba(207, 231, 238, 0.7);
  border-bottom: 1px solid rgba(0, 228, 255, 0.1);
  font-family: 'JetBrains Mono', monospace;
}
.crews-status--error { color: #ff7676; }

.crews-list {
  padding: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.crew-card {
  display: block;
  width: 100%;
  text-align: left;
  background: rgba(0, 228, 255, 0.04);
  border: 1px solid rgba(0, 228, 255, 0.15);
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 6px;
  color: #e9f3f6;
  cursor: pointer;
  transition: all 0.14s ease;
  font: inherit;
}
.crew-card:hover {
  background: rgba(0, 228, 255, 0.1);
  border-color: rgba(0, 228, 255, 0.45);
}
.crew-card__name {
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--cyan, #00e4ff);
  text-transform: uppercase;
}
.crew-card__desc { font-size: 12px; color: rgba(207, 231, 238, 0.85); margin: 4px 0 6px; }
.crew-card__agents {
  font-size: 10px;
  color: rgba(207, 231, 238, 0.55);
  font-family: 'JetBrains Mono', monospace;
}

.crews-form-wrap { padding: 8px 12px; border-top: 1px solid rgba(0, 228, 255, 0.12); }
.crews-form-wrap.hidden { display: none; }
.crew-form__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  color: var(--cyan, #00e4ff);
}
.crew-form { display: flex; flex-direction: column; gap: 6px; }
.crew-field { display: flex; flex-direction: column; gap: 3px; font-size: 11px; }
.crew-field span { color: rgba(207, 231, 238, 0.7); text-transform: uppercase; letter-spacing: 0.08em; }
.crew-field input {
  background: rgba(0, 228, 255, 0.05);
  border: 1px solid rgba(0, 228, 255, 0.2);
  color: #e9f3f6;
  padding: 6px 8px;
  border-radius: 3px;
  font: inherit;
}
.crew-field input:focus { outline: none; border-color: var(--cyan, #00e4ff); }

.crews-cta {
  background: linear-gradient(180deg, rgba(0, 228, 255, 0.25), rgba(0, 228, 255, 0.1));
  border: 1px solid rgba(0, 228, 255, 0.5);
  color: var(--cyan, #00e4ff);
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 4px;
}
.crews-cta:hover { background: linear-gradient(180deg, rgba(0, 228, 255, 0.4), rgba(0, 228, 255, 0.18)); }
.crews-cta--danger {
  color: #ff9090;
  border-color: rgba(255, 100, 100, 0.55);
  background: linear-gradient(180deg, rgba(255, 100, 100, 0.2), rgba(255, 100, 100, 0.06));
}
.crews-cta--danger:hover { background: linear-gradient(180deg, rgba(255, 100, 100, 0.35), rgba(255, 100, 100, 0.12)); }

.crews-section-title {
  margin: 12px 14px 4px;
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: rgba(207, 231, 238, 0.55);
  text-transform: uppercase;
}

.crews-runs { padding: 0 8px 12px; max-height: 260px; overflow-y: auto; }
.crews-empty { padding: 16px 12px; color: rgba(207, 231, 238, 0.4); font-style: italic; font-size: 12px; }

.crew-run {
  border-left: 2px solid rgba(0, 228, 255, 0.35);
  padding: 8px 10px;
  margin-bottom: 6px;
  background: rgba(0, 228, 255, 0.03);
  border-radius: 0 4px 4px 0;
}
.crew-run--run-completed { border-left-color: #4ade80; }
.crew-run--run-failed,
.crew-run--run-cancelled { border-left-color: #ff7676; }
.crew-run--awaiting_approval,
.crew-run--approval-required { border-left-color: #fbbf24; }

.crew-run__main {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  letter-spacing: 0.06em;
}
.crew-run__id { font-family: 'JetBrains Mono', monospace; color: rgba(207, 231, 238, 0.4); font-size: 10px; }
.crew-run__status { color: var(--cyan, #00e4ff); text-transform: uppercase; font-size: 10px; }
.crew-run__sub { font-size: 11px; color: rgba(207, 231, 238, 0.7); margin-top: 4px; }
.crew-run__actions { display: flex; gap: 4px; margin-top: 6px; }

.crews-mini {
  background: transparent;
  border: 1px solid rgba(0, 228, 255, 0.25);
  color: rgba(207, 231, 238, 0.85);
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 10px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.crews-mini:hover { background: rgba(0, 228, 255, 0.1); }
.crews-mini--danger { color: #ff9090; border-color: rgba(255, 100, 100, 0.4); }

.crews-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.crews-modal__inner {
  width: min(720px, 100%);
  max-height: 90vh;
  background: rgba(1, 4, 8, 0.96);
  border: 1px solid rgba(0, 228, 255, 0.4);
  border-radius: 6px;
  box-shadow: 0 0 80px rgba(0, 228, 255, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.crews-modal__head {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(0, 228, 255, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--cyan, #00e4ff);
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 0.1em;
  font-size: 12px;
}
.crews-modal__body { padding: 14px; color: #cfe7ee; overflow-y: auto; }
.crews-modal__body p { margin: 0 0 8px; }
.crews-modal__body blockquote {
  margin: 8px 0;
  padding: 8px 12px;
  border-left: 2px solid var(--cyan, #00e4ff);
  background: rgba(0, 228, 255, 0.05);
  color: rgba(207, 231, 238, 0.9);
  font-style: italic;
}
.crews-modal__body textarea {
  width: 100%;
  background: rgba(0, 228, 255, 0.05);
  border: 1px solid rgba(0, 228, 255, 0.25);
  color: #e9f3f6;
  padding: 8px 10px;
  border-radius: 3px;
  font: inherit;
  resize: vertical;
}
.crews-modal__pre {
  margin: 0;
  padding: 14px;
  overflow: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #e9f3f6;
  background: rgba(0, 0, 0, 0.4);
  white-space: pre-wrap;
  max-height: 60vh;
}
.crews-modal__foot {
  padding: 10px 14px;
  border-top: 1px solid rgba(0, 228, 255, 0.18);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
