/* shared.css 프리미티브(kx-detailview 상세 뷰 hero·meta·badge 등) 선반영 */
@import '../shared.css';

.kx-rev {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.kx-rev__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-5);
  border-bottom: var(--border-card);
  background: var(--color-white);
}
.kx-rev__crumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-caption);
  color: var(--color-neutral-500);
  margin-bottom: var(--space-1);
}
.kx-rev__crumb button {
  border: none;
  background: none;
  color: var(--color-neutral-500);
  cursor: pointer;
  font-size: var(--fs-caption);
  padding: 0;
}
.kx-rev__crumb button:hover {
  color: var(--color-primary-600);
}
.kx-rev__crumb-cur {
  color: var(--color-neutral-900);
}
.kx-rev__title-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.kx-rev__title-row h1 {
  font-size: var(--fs-h3);
  color: var(--color-neutral-900);
}
.kx-rev__meta {
  font-size: var(--fs-micro);
  color: var(--color-neutral-500);
  background: var(--color-neutral-100);
  border: 1px solid var(--color-neutral-200);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.kx-rev__body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* 캔버스 */
.kx-rev__canvas {
  flex: 7;
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--color-canvas-bg);
  border-right: var(--border-card);
}
.kx-rev__canvas-top {
  position: absolute;
  top: var(--space-4);
  left: var(--space-4);
  right: var(--space-4);
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  pointer-events: none;
}
.kx-rev__tabs {
  display: flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 3px;
  pointer-events: auto;
}
.kx-rev__tabs button {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-caption);
  cursor: pointer;
}
.kx-rev__tabs button.is-active {
  background: rgba(0, 102, 179, 0.35);
  color: var(--color-on-accent);
  border: 1px solid rgba(0, 102, 179, 0.5);
}
.kx-rev__overlay-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  border: 1px solid var(--color-ai-accent);
  color: var(--color-on-accent);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: var(--fs-caption);
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 0 15px rgba(109, 74, 255, 0.2);
}
.kx-rev__switch {
  width: 30px;
  height: 16px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.25);
  position: relative;
}
.kx-rev__overlay-toggle.is-on .kx-rev__switch {
  background: var(--color-ai-accent);
}
.kx-rev__switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-white);
  transition: left 0.15s;
}
.kx-rev__overlay-toggle.is-on .kx-rev__switch-knob {
  left: 16px;
}

.kx-rev__viewer {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.kx-rev__grid-bg {
  position: absolute;
  inset: 0;
  opacity: 0.2;
  background-image: radial-gradient(circle at 2px 2px, white 1px, transparent 0);
  background-size: 40px 40px;
}
.kx-rev__drawing {
  position: relative;
  width: 78%;
  height: 78%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}
.kx-rev__drawing img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.75;
  mix-blend-mode: screen;
}
.kx-rev__pin {
  position: absolute;
  width: 30px;
  height: 30px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--color-error);
  color: var(--color-on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--fw-bold);
  font-size: var(--fs-caption);
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.kx-rev__zoom {
  position: absolute;
  bottom: var(--space-4);
  right: var(--space-4);
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.kx-rev__zoom button {
  border: none;
  background: transparent;
  color: var(--color-on-accent);
  padding: 8px 10px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 15px;
}
.kx-rev__zoom button:last-child {
  border-bottom: none;
}
.kx-rev__zoom button:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* 우 패널 */
.kx-rev__panel {
  flex: 3;
  min-width: 300px;
  background: var(--color-white);
  overflow-y: auto;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.kx-rev__ai-card {
  border: var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.kx-rev__ai-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3);
  background: var(--color-ai-surface);
  border-bottom: 1px solid var(--color-neutral-200);
}
.kx-rev__ai-count {
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  color: var(--color-error);
  background: #fef3f2;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}
.kx-rev__vlist {
  list-style: none;
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.kx-rev__vlist li {
  display: flex;
  gap: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-neutral-100);
}
.kx-rev__vlist li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.kx-rev__vpin {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fef3f2;
  color: var(--color-error);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--fw-bold);
  font-size: var(--fs-caption);
  flex-shrink: 0;
}
.kx-rev__vtitle {
  font-size: var(--fs-body);
  font-weight: var(--fw-semibold);
  color: var(--color-neutral-900);
  margin-bottom: 2px;
}
.kx-rev__vdetail {
  font-size: var(--fs-caption);
  color: var(--color-neutral-500);
  margin-bottom: var(--space-2);
  line-height: 16px;
}
.kx-rev__vcheck {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-caption);
  color: var(--color-neutral-700);
  cursor: pointer;
}

.kx-rev__thread h3 {
  font-size: var(--fs-h3);
  color: var(--color-neutral-900);
  margin-bottom: var(--space-3);
}
.kx-rev__comment {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.kx-rev__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary-100);
  color: var(--color-primary-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  flex-shrink: 0;
}
.kx-rev__avatar--con {
  background: var(--color-ai-surface);
  color: var(--color-ai-accent);
}
.kx-rev__comment-top {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: 2px;
}
.kx-rev__comment-top strong {
  font-size: var(--fs-caption);
  color: var(--color-neutral-900);
}
.kx-rev__comment-top span {
  font-size: var(--fs-micro);
  color: var(--color-neutral-500);
}
.kx-rev__comment p {
  font-size: var(--fs-caption);
  color: var(--color-neutral-700);
  line-height: 16px;
}

/* 하단 */
.kx-rev__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-5);
  border-top: var(--border-card);
  background: var(--color-white);
}
.kx-rev__foot-note {
  font-size: var(--fs-caption);
  color: var(--color-neutral-500);
}
.kx-rev__foot-actions {
  display: flex;
  gap: var(--space-3);
}

/* F028 실배선 — 결재선 단계·의견 입력 */
.kx-rev__foot-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.kx-rev__comment-input {
  width: 100%;
  max-width: 520px;
  padding: 8px 12px;
  border: var(--border-card);
  border-radius: 8px;
  font-size: var(--fs-caption);
}
.kx-rev__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.kx-rev__step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--color-neutral-50, #f8fafc);
}
.kx-rev__step-no {
  flex: 0 0 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  background: rgba(148, 163, 184, 0.2);
  color: #475569;
}
.kx-rev__step--cur {
  background: rgba(31, 41, 252, 0.08);
}
.kx-rev__step--cur .kx-rev__step-no {
  background: #1f29fc;
  color: var(--color-on-accent);
}
.kx-rev__step--ok .kx-rev__step-no {
  background: #10b981;
  color: var(--color-on-accent);
}
.kx-rev__step--bad .kx-rev__step-no {
  background: #ef4444;
  color: var(--color-on-accent);
}
.kx-rev__step--skip {
  opacity: 0.6;
}
