/**
 * 工单进展 · 统一设计系统（管理端浅色 / 前台深色自适应）
 */
.iflow-panel {
  --if-bg: #f7f8fa;
  --if-card: #ffffff;
  --if-text: #1d2129;
  --if-text-2: #4e5969;
  --if-text-3: #86909c;
  --if-border: #e5e6eb;
  --if-primary: #165dff;
  --if-success: #00b42a;
  --if-warning: #ff7d00;
  --if-danger: #f53f3f;
  --if-purple: #722ed1;
  --if-cyan: #0fc6c2;
  font-size: 14px;
  color: var(--if-text);
  line-height: 1.5;
}

.iflow-panel--dark {
  --if-bg: rgba(8, 22, 42, 0.6);
  --if-card: rgba(12, 32, 58, 0.85);
  --if-text: #f1f5f9;
  --if-text-2: #cbd5e1;
  --if-text-3: #94a3b8;
  --if-border: rgba(148, 163, 184, 0.2);
}

/* Header */
.iflow-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.iflow-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.iflow-header-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #165dff 0%, #4080ff 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(22, 93, 255, 0.35);
}
.iflow-header-icon svg {
  width: 20px;
  height: 20px;
}
.iflow-header-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--if-text);
}
.iflow-header-sub {
  font-size: 12px;
  color: var(--if-text-3);
}

/* Status banner */
.iflow-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--if-border);
  background: var(--if-card);
}
.iflow-banner--primary {
  background: linear-gradient(135deg, #f0f5ff 0%, #e8f3ff 100%);
  border-color: #bedaff;
}
.iflow-banner--success {
  background: linear-gradient(135deg, #e8ffea 0%, #f0fff1 100%);
  border-color: #aff0b5;
}
.iflow-banner--warning {
  background: linear-gradient(135deg, #fff7e8 0%, #fff9f0 100%);
  border-color: #ffddb0;
}
.iflow-banner--danger {
  background: linear-gradient(135deg, #ffece8 0%, #fff5f3 100%);
  border-color: #fdcdc5;
}
.iflow-banner-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #fff;
  box-shadow: 0 2px 8px rgba(29, 33, 41, 0.08);
}
.iflow-banner--primary .iflow-banner-icon { color: var(--if-primary); }
.iflow-banner--success .iflow-banner-icon { color: var(--if-success); }
.iflow-banner--warning .iflow-banner-icon { color: var(--if-warning); }
.iflow-banner--danger .iflow-banner-icon { color: var(--if-danger); }
.iflow-banner-icon svg {
  width: 24px;
  height: 24px;
}
.iflow-banner-label {
  display: block;
  font-size: 12px;
  color: var(--if-text-3);
  margin-bottom: 2px;
}
.iflow-banner-status {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--if-text);
  line-height: 1.3;
}
.iflow-banner-time {
  display: block;
  font-size: 12px;
  color: var(--if-text-3);
  margin-top: 4px;
}

/* Latest card */
.iflow-latest {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  margin-bottom: 20px;
  background: var(--if-card);
  border: 1px solid var(--if-border);
  border-left: 4px solid var(--if-primary);
}
.iflow-latest-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f2f3f5;
  color: var(--if-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.iflow-latest-icon svg {
  width: 18px;
  height: 18px;
}
.iflow-latest-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--if-text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.iflow-latest-text {
  margin: 0;
  font-size: 14px;
  color: var(--if-text);
  line-height: 1.55;
}

/* Sections */
.iflow-section {
  margin-bottom: 20px;
  padding: 16px;
  border-radius: 12px;
  background: var(--if-card);
  border: 1px solid var(--if-border);
}
.iflow-section--last {
  margin-bottom: 0;
}
.iflow-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--if-text);
}
.iflow-section-title em {
  font-style: normal;
  font-weight: 500;
  color: var(--if-text-3);
  font-size: 12px;
}
.iflow-section-bar {
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--if-primary);
}

/* Vertical stepper */
.iflow-stepper {
  padding: 4px 0 0 4px;
}
.iflow-step {
  display: flex;
  gap: 14px;
  min-height: 56px;
}
.iflow-step--last {
  min-height: auto;
}
.iflow-step-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 32px;
  flex-shrink: 0;
}
.iflow-step-node {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f2f3f5;
  color: var(--if-text-3);
  border: 2px solid var(--if-border);
  flex-shrink: 0;
  z-index: 1;
}
.iflow-step-node svg {
  width: 16px;
  height: 16px;
}
.iflow-step-line {
  flex: 1;
  width: 2px;
  min-height: 20px;
  margin: 4px 0;
  background: var(--if-border);
  border-radius: 1px;
}
.iflow-step--done .iflow-step-node {
  background: #e8ffea;
  border-color: #aff0b5;
  color: var(--if-success);
}
.iflow-step--done .iflow-step-line {
  background: #aff0b5;
}
.iflow-step--current .iflow-step-node {
  background: var(--if-primary);
  border-color: var(--if-primary);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(22, 93, 255, 0.2);
}
.iflow-step--current .iflow-step-line {
  background: linear-gradient(180deg, var(--if-primary) 0%, var(--if-border) 100%);
}
.iflow-step--danger.iflow-step--current .iflow-step-node {
  background: var(--if-danger);
  border-color: var(--if-danger);
  box-shadow: 0 0 0 4px rgba(245, 63, 63, 0.2);
}
.iflow-step--wait .iflow-step-node {
  background: #fafbfc;
  color: #c9cdd4;
}
.iflow-step-content {
  flex: 1;
  padding: 4px 0 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.iflow-step--last .iflow-step-content {
  padding-bottom: 0;
}
.iflow-step-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--if-text);
}
.iflow-step--wait .iflow-step-title {
  color: var(--if-text-3);
  font-weight: 500;
}
.iflow-step-desc {
  font-size: 12px;
  color: var(--if-text-3);
  width: 100%;
}
.iflow-step-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: #e8f3ff;
  color: var(--if-primary);
  font-weight: 600;
}

/* Participants */
.iflow-people {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.iflow-person {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--if-bg);
  border: 1px solid transparent;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.iflow-person:hover {
  border-color: var(--if-border);
  box-shadow: 0 2px 8px rgba(29, 33, 41, 0.06);
}
.iflow-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.iflow-person-main {
  flex: 1;
  min-width: 0;
}
.iflow-person-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.iflow-person-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--if-text);
}
.iflow-person-dept {
  font-size: 12px;
  color: var(--if-text-3);
}
.iflow-role-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.iflow-role-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--role-color) 12%, transparent);
  color: var(--role-color);
  border: 1px solid color-mix(in srgb, var(--role-color) 25%, transparent);
  font-weight: 500;
}

/* Activity feed */
.iflow-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.iflow-feed-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--if-border);
}
.iflow-feed-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.iflow-feed-item:first-child {
  padding-top: 0;
}
.iflow-feed-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f2f3f5;
  color: var(--if-text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.iflow-feed-item--latest .iflow-feed-icon {
  background: #e8f3ff;
  color: var(--if-primary);
}
.iflow-feed-icon svg {
  width: 16px;
  height: 16px;
}
.iflow-feed-body {
  flex: 1;
  min-width: 0;
}
.iflow-feed-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.iflow-feed-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--if-text);
}
.iflow-feed-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--if-primary);
  color: #fff;
  font-weight: 600;
}
.iflow-feed-meta {
  font-size: 12px;
  color: var(--if-text-3);
  margin-top: 4px;
}
.iflow-feed-user {
  color: var(--if-text-2);
}
.iflow-feed-note {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--if-bg);
  font-size: 13px;
  color: var(--if-text-2);
  line-height: 1.45;
}

.iflow-empty {
  text-align: center;
  padding: 24px;
  color: var(--if-text-3);
  font-size: 13px;
}

/* Tags for table */
.iflow-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}
.iflow-tag--primary { background: #e8f3ff; color: var(--if-primary); }
.iflow-tag--success { background: #e8ffea; color: var(--if-success); }
.iflow-tag--warning { background: #fff7e8; color: var(--if-warning); }
.iflow-tag--danger { background: #ffece8; color: var(--if-danger); }

/* Mobile wrap */
.issue-progress-card-wrap {
  padding: 0 !important;
  overflow: hidden;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}
.issue-progress-card-wrap .iflow-panel {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--if-border);
  background: var(--if-card);
}
.issue-progress-card-wrap .iflow-panel--dark {
  box-shadow: 0 8px 32px rgba(0, 20, 50, 0.35);
}

/* List item progress (mobile) */
.issue-list-progress-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(22, 93, 255, 0.08);
  border: 1px solid rgba(22, 93, 255, 0.15);
}
.issue-list-progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--if-primary, #165dff);
  flex-shrink: 0;
  animation: iflow-pulse 2s ease infinite;
}
@keyframes iflow-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.9); }
}
.issue-list-progress-text {
  flex: 1;
  font-size: 12px;
  color: var(--if-text-2, #4e5969);
  line-height: 1.4;
}
.issue-list-progress-time {
  font-size: 11px;
  color: var(--if-text-3, #86909c);
  white-space: nowrap;
}

/* Admin drawer integration */
.issue-tracker-drawer-body .iflow-panel {
  padding: 0 4px 20px;
}
.issue-tracker-drawer-body .iflow-section {
  box-shadow: none;
}
