/* ═══════════════════════════════════════════════════════════════
 * Navio Orchestra Panel styles — Sprint 0.40 D.3.1.e
 * Slide-in panel (mirrors crew-panel) showing sagas + agent registry.
 * RTL Hebrew. Loaded via <link> in dashboard/index.html.
 * ═══════════════════════════════════════════════════════════════ */

#orchestra-panel {
  position: fixed;
  top: 0;
  left: 0;                 /* RTL: slide in from the left edge */
  width: 380px;
  height: 100vh;
  background: #0f1117;
  color: #e6e6e6;
  border-right: 1px solid #2a2d36;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  z-index: 940;
  overflow-y: auto;
  direction: rtl;
  font-family: inherit;
}

#orchestra-panel.orch-open {
  transform: translateX(0);
}

#orchestra-panel .orch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #2a2d36;
  background: #151823;
  position: sticky;
  top: 0;
}

#orchestra-panel .orch-title {
  font-size: 15px;
  font-weight: 700;
}

#orchestra-panel .orch-close {
  cursor: pointer;
  background: none;
  border: none;
  color: #9aa0ab;
  font-size: 18px;
}

#orchestra-body {
  padding: 12px 16px 40px;
}

.orch-h {
  font-size: 13px;
  font-weight: 700;
  color: #8fb4ff;
  margin: 16px 0 8px;
}

.orch-empty {
  color: #6b7280;
  font-size: 12px;
  padding: 8px 0;
}

.orch-saga {
  background: #161922;
  border: 1px solid #262a35;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
}

.orch-saga-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.orch-saga-def {
  font-weight: 600;
  font-size: 13px;
}

.orch-saga-steps {
  font-size: 11px;
  color: #9aa0ab;
  margin-bottom: 8px;
  word-break: break-word;
}

.orch-saga-actions {
  display: flex;
  gap: 8px;
}

.orch-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.orch-st-pending  { background: #374151; color: #d1d5db; }
.orch-st-running  { background: #1e3a8a; color: #bfdbfe; }
.orch-st-paused   { background: #92400e; color: #fde68a; }
.orch-st-comp     { background: #7f1d1d; color: #fecaca; }
.orch-st-done     { background: #14532d; color: #bbf7d0; }
.orch-st-failed   { background: #7f1d1d; color: #fecaca; }

.orch-btn {
  flex: 1;
  padding: 6px 0;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.orch-approve { background: #15803d; color: #fff; }
.orch-approve:hover { background: #166534; }
.orch-reject  { background: #b91c1c; color: #fff; }
.orch-reject:hover  { background: #991b1b; }

.orch-agents {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.orch-agent {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #161922;
  border: 1px solid #262a35;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
}

.orch-agent-name { font-weight: 600; }

.orch-agent-level {
  font-size: 10px;
  color: #8fb4ff;
  background: #1e2433;
  padding: 2px 6px;
  border-radius: 8px;
}

/* Floating launcher button — bottom-left, mirrors the crew chat bubble */
#orchestra-launcher {
  position: fixed;
  bottom: 92px;
  left: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #6d4aff;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 22px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  z-index: 930;
}

#orchestra-launcher:hover { background: #5a3ce0; }

/* Sprint 0.41 — count badge on the launcher when work is pending */
#orchestra-launcher.orch-launcher-has-work::after {
  content: attr(data-count);
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 22px;
  text-align: center;
  box-shadow: 0 0 0 2px #0f1117;
  animation: orch-pulse 2s ease-in-out infinite;
}
@keyframes orch-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

/* Sprint 0.41 — filter toolbar inside the panel */
.orch-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.orch-flt {
  flex: 1 1 auto;
  background: #1a1e2a;
  border: 1px solid #262a35;
  color: #d1d5db;
  border-radius: 6px;
  padding: 5px 8px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  gap: 6px;
}
.orch-flt:hover { background: #232838; }
.orch-flt-active {
  background: #1e3a8a;
  border-color: #3b82f6;
  color: #fff;
}
.orch-flt-n {
  background: rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 0 6px;
  font-size: 10px;
}

/* Bulk action bar (only when at least one is selected in the paused view) */
.orch-bulk {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 600;
  flex-wrap: wrap;
}
.orch-bulk > span { color: #fde68a; }
.orch-bulk-approve, .orch-bulk-reject, .orch-bulk-clear {
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.orch-bulk-approve { background: #15803d; color: #fff; }
.orch-bulk-reject  { background: #b91c1c; color: #fff; }
.orch-bulk-clear   { background: #374151; color: #d1d5db; margin-right: auto; }

/* Saga card enrichments */
.orch-saga-paused {
  border-color: #92400e;
}
.orch-saga-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}
.orch-chk {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #15803d;
}
.orch-saga-vendor {
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.orch-inv {
  font-size: 10px;
  color: #94a3b8;
  background: #1e2433;
  padding: 1px 6px;
  border-radius: 6px;
}
.orch-saga-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
  font-size: 12px;
}
.orch-amount {
  color: #fbbf24;
  font-weight: 700;
}
.orch-po {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 6px;
  font-weight: 600;
}
.orch-po-ok   { background: #14532d; color: #bbf7d0; }
.orch-po-miss { background: #7f1d1d; color: #fecaca; }

/* Dashboard alert card — Sprint 0.41 Day-1 visibility fix */
.orch-badge-card {
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  border: 1px solid #6d28d9;
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 12px;
  cursor: pointer;
  color: #fff;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.35);
  transition: transform 0.15s ease;
}
.orch-badge-card:hover { transform: translateY(-2px); }
.orch-badge-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.orch-badge-icon { font-size: 24px; }
.orch-badge-num {
  font-size: 28px;
  font-weight: 800;
}
.orch-badge-label {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
}
.orch-badge-sub {
  margin-top: 4px;
  font-size: 12px;
  opacity: 0.85;
}
