/* ============================================
   INSTRUCTION — 기계별 지시서 화면 전용 CSS
   mia instruction.html에서 추출. 클래스명 변경 금지.
   ============================================ */

/* ===== 수주 정보 섹션 ===== */
.selection-section {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.selection-item {
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  flex: 1;
}

.selection-label {
  font-size: 0.75rem;
  color: var(--tertiary);
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.selection-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--brand);
}

/* ===== 탭 컨테이너 ===== */
.tabs-container {
  background: #FFFFFF;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-bottom: 1.5rem;
}

.tabs-buttons {
  display: flex;
  flex-direction: row;
  gap: 0.25rem;
  border-bottom: 2px solid var(--tint);
  margin-bottom: 1.25rem;
  overflow-x: auto;
}

.tab-button {
  padding: 0.75rem 1.25rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--tertiary);
  transition: all 0.25s ease;
  white-space: nowrap;
  margin-bottom: -2px;
}

.tab-button:hover {
  color: var(--brand);
  background: var(--bg-light);
}

.tab-button.active {
  border-bottom-color: #3B82F6;
  color: #3B82F6;
  font-weight: 700;
}

.tab-button .progress-count {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #3B82F6;
  background: rgba(59, 130, 246, 0.1);
  padding: 0.125rem 0.5rem;
  border-radius: 10px;
  margin-left: 0.375rem;
}

.tab-button .assignee-name {
  display: block;
  font-size: 0.625rem;
  font-weight: 400;
  color: var(--light);
  margin-top: 0.125rem;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ===== 탭 헤더바 (담당자 + 진행률) ===== */
.tab-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--tint);
}

.tab-assignee {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-assignee label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--tertiary);
  white-space: nowrap;
}

.tab-assignee select {
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--tint);
  border-radius: 8px;
  font-size: 0.8125rem;
  color: var(--brand);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.tab-assignee select:focus {
  outline: none;
  border-color: #3B82F6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.tab-progress-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--light);
}

.tab-progress-label span {
  color: #3B82F6;
  font-weight: 700;
}

/* ===== 작업 카드 그리드 ===== */
.work-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.work-card {
  background: #fff;
  border: 1px solid var(--tint);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  transition: all 0.25s ease;
  position: relative;
}

.work-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.work-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.work-card-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--brand);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.work-card-title .card-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--bg-light);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--light);
}

.work-card-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
}

.work-card-details .detail-item {
  display: flex;
  flex-direction: column;
}

.work-card-details .detail-label {
  font-size: 0.6875rem;
  color: var(--light);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 0.125rem;
}

.work-card-details .detail-value {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--brand);
}

.work-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--tint);
}

/* ===== 상태 토글 버튼 ===== */
.status-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  letter-spacing: 0.3px;
}

.status-toggle.status-waiting {
  background: #F3F4F6;
  color: #6B7280;
}

.status-toggle.status-progress {
  background: #FEF3C7;
  color: #92400E;
}

.status-toggle.status-complete {
  background: #D1FAE5;
  color: #065F46;
}

.status-toggle.status-rejected {
  background: #FEE2E2;
  color: #991B1B;
}

/* ===== 반려 / 완료 체크 버튼 ===== */
.reject-btn {
  background: none;
  border: 1px solid #FCA5A5;
  color: #EF4444;
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reject-btn:hover {
  background: #FEE2E2;
}

.complete-check-btn {
  background: none;
  border: 1px solid var(--tint);
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--tertiary);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.complete-check-btn:hover {
  border-color: #22C55E;
  color: #15803D;
}

.complete-check-btn.checked {
  background: #D1FAE5;
  border-color: #22C55E;
  color: #065F46;
}

/* ===== 편집 잠금 배너 ===== */
.edit-lock-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 0.8125rem;
  color: var(--brand);
}

.edit-lock-banner .lock-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #F59E0B;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 700;
  flex-shrink: 0;
}

.edit-lock-banner .lock-readonly {
  padding: 2px 8px;
  background: rgba(245, 158, 11, 0.15);
  color: #B45309;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
}

.edit-lock-banner .lock-request-btn {
  margin-left: auto;
  padding: 4px 12px;
  border: 1px solid var(--tint);
  border-radius: 6px;
  background: white;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--tertiary);
  cursor: pointer;
  font-family: inherit;
}

.edit-lock-banner .lock-request-btn:hover {
  background: var(--bg-light);
}

/* ===== 지시서 테이블 (index용) ===== */
.instruction-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.instruction-table thead {
  background: var(--background);
}

.instruction-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--tertiary);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--tint);
}

.instruction-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--tint);
  color: var(--brand);
}

.instruction-table tbody tr:hover {
  background: var(--bg-light);
}

.instruction-table tbody tr:nth-child(even) {
  background: rgba(245, 246, 248, 0.5);
}

.instruction-table tbody tr:nth-child(even):hover {
  background: var(--bg-light);
}

.row-index {
  text-align: center;
  width: 48px;
  color: var(--light);
  font-weight: 600;
}

.product-name {
  font-weight: 500;
  color: var(--brand);
}

.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ===== 플레이스홀더 ===== */
.placeholder-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
  background: var(--background);
  border-radius: 10px;
  border: 2px dashed var(--tint);
}

.placeholder-icon {
  font-size: 2.5rem;
  color: var(--light);
  margin-bottom: 1rem;
}

.placeholder-text {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 0.5rem;
}

.placeholder-desc {
  font-size: 0.875rem;
  color: var(--tertiary);
}

/* ===== 하단 액션 버튼 ===== */
.instruction-actions {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.instruction-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
}

.instruction-actions .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.instruction-actions .btn-primary {
  background: #3B82F6;
  color: #FFFFFF;
}

.instruction-actions .btn-primary:hover {
  background: #1E40AF;
}

.instruction-actions .btn-secondary {
  background: transparent;
  color: var(--tertiary);
  border: 1px solid var(--tint);
}

.instruction-actions .btn-secondary:hover {
  background: var(--bg-light);
  color: var(--brand);
  border-color: var(--light);
}

.instruction-actions .btn-accent {
  background: #0D9488;
  color: #FFFFFF;
}

.instruction-actions .btn-accent:hover {
  background: #0F766E;
}
