/* ==========================================================================
   Youranke · Batch 7 (Ops) Stylesheet
   Monochrome + Cobalt console UI for #models, #task-plugins,
   #request-processing, and #system-info. Strict CSP: zero inline styles.
   ========================================================================== */

.ops-stack {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.ops-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.ops-toolbar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.ops-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.75rem;
}

.ops-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 1rem 1.15rem;
  min-width: 0;
}

.ops-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.ops-card-head h2,
.ops-card-head h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.ops-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--soft);
  font-size: 0.88rem;
  color: var(--ink-2);
}

.ops-banner.is-warn {
  background: var(--warning-soft);
  border-color: var(--warning-border);
  color: var(--warning);
}

.ops-banner.is-error {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger);
}

.ops-banner.is-info {
  background: var(--info-soft);
  border-color: var(--info-border);
  color: var(--brand-ink);
}

.ops-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.ops-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.14rem 0.48rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-2);
  font-size: 0.74rem;
  line-height: 1.3;
  white-space: nowrap;
}

.ops-chip.is-accent {
  background: var(--brand-soft);
  border-color: var(--brand-border);
  color: var(--brand-ink);
}

.ops-chip.is-warn {
  background: var(--warning-soft);
  border-color: var(--warning-border);
  color: var(--warning);
}

.ops-chip.is-danger {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger);
}

.ops-cell-stack {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.ops-cell-title {
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.ops-cell-sub {
  font-size: 0.78rem;
  color: var(--quiet);
  overflow-wrap: anywhere;
}

.ops-row-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.ops-plugin-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--surface);
  font-size: 0.82rem;
  font-weight: 650;
  flex-shrink: 0;
}

/* Switch Toggle */
.ops-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 500;
}

.ops-switch input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--brand);
  cursor: pointer;
}

/* Sync Wizard Steps */
.ops-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.ops-step {
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--quiet);
  font-size: 0.8rem;
  font-weight: 500;
  text-align: center;
}

.ops-step.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-ink);
}

.ops-step.is-done {
  border-color: var(--success-border);
  background: var(--success-soft);
  color: var(--success);
}

.ops-scroll-box {
  max-height: 18rem;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 0.5rem 0.75rem;
}

.ops-check-list {
  display: grid;
  gap: 0.35rem;
}

.ops-check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.35rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
}

.ops-check-row:hover {
  background: var(--row-hover);
}

.ops-check-row label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  cursor: pointer;
}

/* Drag & Drop Lists (Plaza Order & Request Processing) */
.ops-dnd-list {
  display: grid;
  gap: 0.5rem;
}

.ops-dnd-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 140ms ease, background 140ms ease;
}

.ops-dnd-item.is-dragging {
  opacity: 0.55;
  border-style: dashed;
}

.ops-dnd-item.is-drag-over {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.ops-dnd-main {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1 1 16rem;
}

.ops-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: var(--radius-sm);
  background: var(--soft);
  color: var(--quiet);
  cursor: grab;
  user-select: none;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.ops-order-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  height: 1.45rem;
  padding: 0 0.35rem;
  border-radius: var(--radius-sm);
  background: var(--soft);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 600;
  flex-shrink: 0;
}

/* Plugin Icon, Market Cards & Code Diff */
.ops-plugin-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.ops-market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr));
  gap: 0.85rem;
}

.ops-market-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.ops-code-editor {
  width: 100%;
  min-height: 13rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.5;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--code-bg);
  color: var(--code-ink);
  resize: vertical;
  tab-size: 2;
}

.ops-diff-box {
  max-height: 20rem;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--code-bg);
  color: var(--code-ink);
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.45;
  padding: 0.45rem 0;
}

.ops-diff-line {
  display: flex;
  gap: 0.6rem;
  padding: 0.08rem 0.75rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ops-diff-line.is-add {
  background: rgba(5, 150, 105, 0.22);
  color: #a7f3d0;
}

.ops-diff-line.is-del {
  background: rgba(220, 38, 38, 0.22);
  color: #fecaca;
}

.ops-diff-sign {
  width: 0.9rem;
  flex-shrink: 0;
  user-select: none;
  opacity: 0.75;
}

/* Multi-stage Pipeline Simulation Trace */
.ops-stage-list {
  display: grid;
  gap: 0.6rem;
}

.ops-stage-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.7rem 0.85rem;
  background: var(--paper);
  display: grid;
  gap: 0.45rem;
}

.ops-stage-card.is-modified {
  border-color: var(--brand-border);
  background: var(--brand-soft);
}

.ops-stage-card.is-blocked {
  border-color: var(--danger-border);
  background: var(--danger-bg);
}

.ops-stage-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.ops-diff-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.ops-json-pre {
  margin: 0;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  background: var(--code-bg);
  color: var(--code-ink);
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1.45;
  max-height: 13rem;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* System Charts & Progress */
.ops-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 0.85rem;
}

.ops-chart-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem 0.85rem;
  background: var(--paper);
  min-width: 0;
}

.ops-chart-panel h4 {
  font-size: 0.84rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
  color: var(--ink-2);
}

.ops-progress {
  width: 100%;
  min-width: 5rem;
  height: 0.55rem;
  accent-color: var(--brand);
}

.ops-endpoint-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 0.35rem;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

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

.ops-form-grid .ops-span-2 {
  grid-column: span 2;
}

.ops-log-box {
  max-height: 16rem;
  overflow: auto;
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius);
  background: var(--code-bg);
  color: var(--code-ink);
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ops-muted {
  color: var(--quiet);
  font-size: 0.83rem;
}

@media (max-width: 720px) {
  .ops-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ops-diff-cols,
  .ops-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .ops-form-grid .ops-span-2 {
    grid-column: span 1;
  }
  .ops-toolbar {
    align-items: stretch;
  }
  .ops-toolbar-group {
    width: 100%;
  }
}
