/* pricing_conditions.css — pc- prefix 필수 (Propshaft 충돌 방지) */

/* Tailwind hidden 클래스 대신 사용 (룰 17: Propshaft 환경) */
.pc-hidden { display: none !important; }

.pc-layout {
  display: flex;
  height: calc(100vh - 56px);
  overflow: hidden;
  background: #f8fafc;
}

/* ── 좌측 패널: 조건 유형 목록 ─────────────────────────── */
.pc-sidebar {
  width: 240px;
  min-width: 240px;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
}

.pc-sidebar-header {
  padding: 16px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pc-type-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.pc-type-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  border-radius: 0;
  transition: background 0.15s;
  text-decoration: none;
  color: #334155;
}

.pc-type-item:hover {
  background: #f1f5f9;
  text-decoration: none;
  color: #334155;
}

.pc-type-item.active {
  background: #eff6ff;
  color: #1d4ed8;
  border-right: 3px solid #3b82f6;
}

.pc-type-step {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  background: #e2e8f0;
  color: #64748b;
  flex-shrink: 0;
}

.pc-type-item.active .pc-type-step {
  background: #3b82f6;
  color: white;
}

.pc-type-info {
  flex: 1;
  min-width: 0;
}

.pc-type-code {
  font-size: 12px;
  font-weight: 600;
  font-family: monospace;
}

.pc-type-name {
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pc-type-item.active .pc-type-name {
  color: #3b82f6;
}

.pc-type-count {
  font-size: 11px;
  background: #e2e8f0;
  color: #64748b;
  border-radius: 10px;
  padding: 1px 7px;
  flex-shrink: 0;
}

.pc-type-item.active .pc-type-count {
  background: #bfdbfe;
  color: #1d4ed8;
}

/* ── 우측 메인 패널 ──────────────────────────────────────── */
.pc-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 툴바 */
.pc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  gap: 12px;
}

.pc-toolbar-title {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
}

.pc-toolbar-code {
  font-size: 12px;
  font-family: monospace;
  color: #64748b;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 4px;
}

.pc-toolbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* 테이블 영역 */
.pc-table-area {
  flex: 1;
  overflow: auto;
  padding: 16px 20px;
}

.pc-records-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.pc-records-table th {
  background: #f8fafc;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.pc-records-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
}

.pc-records-table tr:hover td {
  background: #f8fafc;
}

.pc-records-table tr:last-child td {
  border-bottom: none;
}

.pc-amount-fixed {
  font-family: monospace;
  font-weight: 500;
}

.pc-amount-percent {
  color: #7c3aed;
  font-weight: 500;
}

.pc-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

.pc-badge-active {
  background: #dcfce7;
  color: #16a34a;
}

.pc-badge-expired {
  background: #fee2e2;
  color: #dc2626;
}

.pc-badge-fixed {
  background: #eff6ff;
  color: #3b82f6;
}

.pc-badge-percent {
  background: #f5f3ff;
  color: #7c3aed;
}

/* 빈 상태 */
.pc-empty {
  text-align: center;
  padding: 60px 20px;
  color: #94a3b8;
}

.pc-empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

/* ── 하단 패널 ───────────────────────────────────────────── */
.pc-bottom {
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
}

/* 7단계 프로시저 */
.pc-procedure {
  padding: 12px 20px;
  border-bottom: 1px solid #e2e8f0;
  overflow-x: auto;
}

.pc-procedure-label {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pc-steps {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: max-content;
}

.pc-step {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  text-decoration: none;
  color: #334155;
}

.pc-step:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  text-decoration: none;
  color: #1d4ed8;
}

.pc-step.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
}

.pc-step-no {
  font-size: 10px;
  font-weight: 700;
  background: rgba(0,0,0,0.08);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pc-step.active .pc-step-no {
  background: rgba(255,255,255,0.25);
}

.pc-step-code {
  font-size: 11px;
  font-family: monospace;
  font-weight: 600;
}

.pc-step-name {
  font-size: 11px;
}

.pc-step-arrow {
  color: #cbd5e1;
  padding: 0 4px;
  font-size: 14px;
}

.pc-step-subtotal {
  background: #fef9c3;
  border-color: #fcd34d;
  color: #92400e;
}

.pc-step-subtotal.active {
  background: #f59e0b;
  border-color: #f59e0b;
  color: white;
}

.pc-step-final {
  background: #dcfce7;
  border-color: #86efac;
  color: #15803d;
}

.pc-step-final.active {
  background: #16a34a;
  border-color: #16a34a;
  color: white;
}

/* 시뮬레이션 패널 */
.pc-simulation {
  padding: 12px 20px;
}

.pc-sim-title {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 10px;
}

.pc-sim-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.pc-sim-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pc-sim-field label {
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
}

.pc-sim-field input,
.pc-sim-field select {
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
  width: 120px;
  color: #334155;
  background: #f8fafc;
}

.pc-sim-field input:focus,
.pc-sim-field select:focus {
  outline: none;
  border-color: #3b82f6;
  background: white;
}

.pc-sim-result {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 8px 16px;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 8px;
  min-width: 280px;
}

.pc-sim-result-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pc-sim-result-label {
  font-size: 10px;
  color: #64748b;
  font-weight: 500;
}

.pc-sim-result-value {
  font-size: 14px;
  font-weight: 700;
  color: #15803d;
  font-family: monospace;
}

.pc-sim-loading {
  color: #64748b;
  font-size: 13px;
}

/* ── 신규 추가 폼 모달 ────────────────────────────────────── */
.pc-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pc-modal {
  background: white;
  border-radius: 12px;
  width: 480px;
  max-width: 95vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.pc-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pc-modal-title {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
}

.pc-modal-body {
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.pc-modal-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pc-modal-field.full {
  grid-column: 1 / -1;
}

.pc-modal-field label {
  font-size: 12px;
  font-weight: 500;
  color: #475569;
}

.pc-modal-field input,
.pc-modal-field select {
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
  color: #334155;
}

.pc-modal-field input:focus,
.pc-modal-field select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}

.pc-modal-footer {
  padding: 14px 20px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ── 공통 버튼 ───────────────────────────────────────────── */
.pc-btn {
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.pc-btn-primary {
  background: #3b82f6;
  color: white;
}

.pc-btn-primary:hover {
  background: #2563eb;
  color: white;
  text-decoration: none;
}

.pc-btn-danger {
  background: #fee2e2;
  color: #dc2626;
}

.pc-btn-danger:hover {
  background: #fecaca;
  text-decoration: none;
  color: #dc2626;
}

.pc-btn-ghost {
  background: transparent;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.pc-btn-ghost:hover {
  background: #f1f5f9;
  text-decoration: none;
  color: #334155;
}

/* --- Rule 17 인라인 style 대체 클래스 --- */
.pc-toolbar-left { display: flex; align-items: center; gap: 10px; }
.pc-modal-close-btn { padding: 4px 8px; }
.pc-sim-total { color: #1d4ed8; }
.pc-empty-small { padding: 20px 16px; font-size: 13px; }
.pc-empty-hint { font-size: 12px; margin-top: 4px; }
.pc-key-code { font-size: 12px; background: #f1f5f9; padding: 2px 6px; border-radius: 3px; }
.pc-key-empty { color: #94a3b8; font-size: 12px; }
.pc-date-cell { font-size: 12px; }
.pc-btn-sm { padding: 4px 10px; font-size: 11px; }
