/* =================================================================
   SACRED STUDIOS — Producer view styles
   Matches the Command Center theme (crimson + gold).
   Linked via @import in views.css.
   ================================================================= */

.producer-hero {
  margin-bottom: 16px;
}
.ph-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.ph-clients {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.ph-client-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s ease;
  color: var(--text-0);
  min-width: 0;
}
.ph-client-chip:hover {
  border-color: var(--accent);
  background: var(--bg-2);
}
.ph-client-chip.selected {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(196,18,48,0.12), rgba(200,161,88,0.06));
  box-shadow: 0 0 0 1px var(--accent-glow);
}
.ph-avatar {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--bg-0);
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}
.ph-avatar.sm { width: 24px; height: 24px; font-size: 11px; border-radius: 6px; }
.ph-meta {
  display: flex; flex-direction: column;
  min-width: 0;
  gap: 1px;
}
.ph-name {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-0);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ph-company {
  font-size: 11.5px;
  color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- Templates ---------- */
.producer-templates { margin-bottom: 16px; }
.hidden { display: none !important; }

.ph-templates {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.ph-template {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s ease;
  color: var(--text-0);
  font: inherit;
}
.ph-template:hover {
  border-color: var(--accent);
  background: var(--bg-2);
  transform: translateY(-1px);
}
.ph-template.selected {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(196,18,48,0.12), rgba(200,161,88,0.06));
  box-shadow: 0 0 0 1px var(--accent-glow);
}
.ph-tmpl-icon {
  font-size: 24px;
  color: var(--accent);
  line-height: 1;
  flex-shrink: 0;
}
.ph-tmpl-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ph-tmpl-label {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-0);
}
.ph-tmpl-desc {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
}

/* ---------- Config card ---------- */
.config-context {
  display: flex; gap: 12px;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.cc-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}
.cc-value {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
  color: var(--text-0);
  flex: 1;
}
.cc-modules { display: flex; gap: 6px; flex-wrap: wrap; margin-left: 12px; }
.ph-tag {
  padding: 2px 8px;
  background: rgba(196,18,48,0.14);
  color: var(--text-1);
  border-radius: 100px;
  font-size: 10.5px;
  font-weight: 600;
}

.config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.config-field {
  display: flex; flex-direction: column;
  gap: 6px;
}
.config-field.full { grid-column: 1 / -1; }
.config-field > span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-2);
}
.config-field input,
.config-field textarea,
.config-field select {
  background: var(--bg-0);
  color: var(--text-0);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 11px;
  font: inherit;
  font-size: 13px;
}
.config-field input:focus,
.config-field textarea:focus,
.config-field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.multi-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 100px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-1);
  transition: all 0.15s ease;
}
.chip-check:hover { border-color: var(--accent); color: var(--text-0); }
.chip-check input { margin: 0; }
.chip-check:has(input:checked) {
  background: var(--accent);
  color: var(--bg-0);
  border-color: var(--accent);
  font-weight: 600;
}

.ph-actions {
  display: flex; justify-content: space-between; gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ---------- Recent runs ---------- */
.producer-runs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.run-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-0);
  transition: all 0.15s ease;
}
.run-row:hover { border-color: var(--accent); background: var(--bg-2); }
.rr-icon {
  font-size: 18px;
  color: var(--accent);
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}
.rr-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rr-title {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rr-meta { font-size: 11.5px; color: var(--text-2); }
.rr-arrow { color: var(--text-3); font-size: 14px; }

/* ---------- Output (run detail) ---------- */
.producer-output {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.po-toolbar {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}
.po-content {
  margin: 0;
  padding: 22px 24px;
  font-family: ui-monospace, 'SF Mono', Monaco, monospace;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-0);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 70vh;
  overflow-y: auto;
}

.ph-spinner {
  font-size: 36px;
  color: var(--accent);
  animation: ph-pulse 1.4s ease-in-out infinite;
  text-align: center;
  margin-bottom: 8px;
}
@keyframes ph-pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.1); }
}

.card.error {
  border-color: var(--p0);
  background: rgba(255, 94, 94, 0.05);
}
.mono { font-family: ui-monospace, monospace; font-size: 12px; color: var(--text-2); }

/* ---------- Sage drawer extensions (wired to W2) ---------- */
.sage-msg.pending {
  color: var(--text-2);
  font-style: italic;
}
.sage-msg.error {
  border-color: var(--p0);
  color: var(--p0);
  background: rgba(255, 94, 94, 0.06);
}
.sage-msg.offline-note {
  border-style: dashed;
  opacity: 0.85;
}
.sage-thinking {
  display: inline-block;
  margin-right: 6px;
  color: var(--accent);
  animation: ph-pulse 1.4s ease-in-out infinite;
}
.sage-msg code {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  background: var(--bg-0);
  padding: 1px 5px;
  border-radius: 4px;
}
.sage-msg b { color: var(--text-0); }
.sage-msg i { color: var(--text-1); }
